mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-06 11:55:32 +00:00
feat(nvim): configuration, refactoring, fixes
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
ansible
|
ansible
|
||||||
pipenv
|
pipenv
|
||||||
semgrep
|
semgrep
|
||||||
|
neovim
|
||||||
|
|||||||
24
config/nvim/.neoconf.json
Normal file
24
config/nvim/.neoconf.json
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"neodev": {
|
||||||
|
"library": {
|
||||||
|
"enabled": true,
|
||||||
|
"plugins": [
|
||||||
|
"nvim-lspconfig",
|
||||||
|
"lsp",
|
||||||
|
"completion",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"neoconf": {
|
||||||
|
"plugins": {
|
||||||
|
"lua_ls": {
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lspconfig": {
|
||||||
|
"lua_ls": {
|
||||||
|
"Lua.completion.callSnippet": "Replace",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,15 +3,18 @@
|
|||||||
-- Install lazylazy
|
-- Install lazylazy
|
||||||
-- https://github.com/folke/lazy.nvim
|
-- https://github.com/folke/lazy.nvim
|
||||||
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
|
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
|
||||||
if not vim.loop.fs_stat(lazypath) then
|
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||||
vim.fn.system {
|
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
|
||||||
'git',
|
local out = vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
|
||||||
'clone',
|
if vim.v.shell_error ~= 0 then
|
||||||
'--filter=blob:none',
|
vim.api.nvim_echo({
|
||||||
'https://github.com/folke/lazy.nvim.git',
|
{ 'Failed to clone lazy.nvim:\n', 'ErrorMsg' },
|
||||||
'--branch=stable', -- latest stable release
|
{ out, 'WarningMsg' },
|
||||||
lazypath,
|
{ '\nPress any key to exit...' },
|
||||||
}
|
}, true, {})
|
||||||
|
vim.fn.getchar()
|
||||||
|
os.exit(1)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
vim.opt.rtp:prepend(lazypath)
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
@@ -22,14 +25,20 @@ require('lazy').setup {
|
|||||||
checker = {
|
checker = {
|
||||||
-- Automatically check for updates
|
-- Automatically check for updates
|
||||||
enabled = true,
|
enabled = true,
|
||||||
|
nofity = false,
|
||||||
},
|
},
|
||||||
spec = {
|
spec = {
|
||||||
-- Useful plugin to show you pending keybinds.
|
-- Useful plugin to show you pending keybinds.
|
||||||
-- https://github.com/folke/which-key.nvim
|
-- https://github.com/folke/which-key.nvim
|
||||||
{
|
{
|
||||||
'folke/which-key.nvim',
|
'folke/which-key.nvim',
|
||||||
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
|
lazy = false, -- Load this plugin lazily
|
||||||
|
version = '*',
|
||||||
priority = 1001, -- Make sure to load this as soon as possible
|
priority = 1001, -- Make sure to load this as soon as possible
|
||||||
|
dependencies = {
|
||||||
|
'nvim-lua/plenary.nvim',
|
||||||
|
'echasnovski/mini.icons',
|
||||||
|
},
|
||||||
config = function() -- This is the function that runs, AFTER loading
|
config = function() -- This is the function that runs, AFTER loading
|
||||||
local wk = require 'which-key'
|
local wk = require 'which-key'
|
||||||
wk.setup()
|
wk.setup()
|
||||||
@@ -38,15 +47,14 @@ require('lazy').setup {
|
|||||||
{ '<leader>b', group = '[b] Buffer' },
|
{ '<leader>b', group = '[b] Buffer' },
|
||||||
{ '<leader>c', group = '[c] Code' },
|
{ '<leader>c', group = '[c] Code' },
|
||||||
{ '<leader>d', group = '[d] Document' },
|
{ '<leader>d', group = '[d] Document' },
|
||||||
{ '<leader>f', group = '[f] File' },
|
|
||||||
{ '<leader>g', group = '[g] Git' },
|
{ '<leader>g', group = '[g] Git' },
|
||||||
{ '<leader>l', group = '[l] LSP' },
|
{ '<leader>l', group = '[l] LSP' },
|
||||||
{ '<leader>o', group = '[o] Open' },
|
|
||||||
{ '<leader>p', group = '[p] Project' },
|
{ '<leader>p', group = '[p] Project' },
|
||||||
{ '<leader>q', group = '[q] Quit' },
|
{ '<leader>q', group = '[q] Quit' },
|
||||||
{ '<leader>s', group = '[s] Search' },
|
{ '<leader>s', group = '[s] Search' },
|
||||||
{ '<leader>t', group = '[t] Toggle' },
|
{ '<leader>t', group = '[t] Toggle' },
|
||||||
{ '<leader>w', group = '[w] Workspace' },
|
{ '<leader>w', group = '[w] Workspace' },
|
||||||
|
{ '<leader>x', group = '[z] Trouble' },
|
||||||
{ '<leader>z', group = '[x] FZF' },
|
{ '<leader>z', group = '[x] FZF' },
|
||||||
{ '<leader>?', group = '[?] Help' },
|
{ '<leader>?', group = '[?] Help' },
|
||||||
{
|
{
|
||||||
@@ -63,5 +71,3 @@ require('lazy').setup {
|
|||||||
{ import = 'plugins' },
|
{ import = 'plugins' },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
require 'config.misc'
|
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
-- Go
|
|
||||||
local format_sync_grp = vim.api.nvim_create_augroup('GoFormat', {})
|
|
||||||
vim.api.nvim_create_autocmd('BufWritePre', {
|
|
||||||
pattern = '*.go',
|
|
||||||
callback = function()
|
|
||||||
require('go.format').goimport()
|
|
||||||
end,
|
|
||||||
group = format_sync_grp,
|
|
||||||
})
|
|
||||||
require('go').setup()
|
|
||||||
@@ -1,15 +1,12 @@
|
|||||||
vim.api.nvim_set_keymap('i', 'jj', '<Esc>', { noremap = false })
|
vim.api.nvim_set_keymap('i', 'jj', '<Esc>', { noremap = false })
|
||||||
|
|
||||||
-- twilight
|
|
||||||
vim.api.nvim_set_keymap('n', 'tw', ':Twilight<enter>', { noremap = false })
|
|
||||||
|
|
||||||
-- buffers
|
-- buffers
|
||||||
vim.api.nvim_set_keymap('n', '<leader>bk', ':blast<enter>', { desc = 'Last', noremap = false })
|
vim.api.nvim_set_keymap('n', '<leader>bk', ':blast<enter>', { desc = 'Buffer: Last', noremap = false })
|
||||||
vim.api.nvim_set_keymap('n', '<leader>bj', ':bfirst<enter>', { desc = 'First', noremap = false })
|
vim.api.nvim_set_keymap('n', '<leader>bj', ':bfirst<enter>', { desc = 'Buffer: First', noremap = false })
|
||||||
vim.api.nvim_set_keymap('n', '<leader>bh', ':bprev<enter>', { desc = 'Prev', noremap = false })
|
vim.api.nvim_set_keymap('n', '<leader>bh', ':bprev<enter>', { desc = 'Buffer: Prev', noremap = false })
|
||||||
vim.api.nvim_set_keymap('n', '<leader>bl', ':bnext<enter>', { desc = 'Next', noremap = false })
|
vim.api.nvim_set_keymap('n', '<leader>bl', ':bnext<enter>', { desc = 'Buffer: Next', noremap = false })
|
||||||
vim.api.nvim_set_keymap('n', '<leader>bd', ':bdelete<enter>', { desc = 'Delete', noremap = false })
|
vim.api.nvim_set_keymap('n', '<leader>bd', ':Bdelete<enter>', { desc = 'Buffer: Delete', noremap = false })
|
||||||
vim.api.nvim_set_keymap('n', '<C-w>', ':bdelete<enter>', { desc = 'Delete buffer', noremap = false })
|
vim.api.nvim_set_keymap('n', '<leader>bw', ':Bwipeout<enter>', { desc = 'Buffer: Wipeout', noremap = false })
|
||||||
|
|
||||||
-- files
|
-- files
|
||||||
vim.api.nvim_set_keymap('n', 'QQ', ':q!<enter>', { desc = 'Quickly Quit', noremap = false })
|
vim.api.nvim_set_keymap('n', 'QQ', ':q!<enter>', { desc = 'Quickly Quit', noremap = false })
|
||||||
@@ -34,9 +31,6 @@ vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
|
|||||||
vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
||||||
vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||||
|
|
||||||
-- Noice
|
|
||||||
vim.api.nvim_set_keymap('n', '<leader>nn', ':Noice dismiss<CR>', { desc = 'Noice dismiss', noremap = true })
|
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>xe', '<cmd>GoIfErr<cr>', { desc = 'Go If Error', silent = true, noremap = true })
|
vim.keymap.set('n', '<leader>xe', '<cmd>GoIfErr<cr>', { desc = 'Go If Error', silent = true, noremap = true })
|
||||||
|
|
||||||
-- TIP: Disable arrow keys in normal mode
|
-- TIP: Disable arrow keys in normal mode
|
||||||
|
|||||||
@@ -78,3 +78,8 @@ vim.o.undofile = true
|
|||||||
vim.o.completeopt = 'menuone,noselect'
|
vim.o.completeopt = 'menuone,noselect'
|
||||||
-- Fixes Notify opacity issues
|
-- Fixes Notify opacity issues
|
||||||
vim.o.termguicolors = true
|
vim.o.termguicolors = true
|
||||||
|
|
||||||
|
-- Set spell checking
|
||||||
|
vim.o.spell = true
|
||||||
|
|
||||||
|
vim.g.loaded_perl_provider = 0
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
return {
|
return {
|
||||||
|
|
||||||
-- fugitive.vim: A Git wrapper so awesome, it should be illegal
|
|
||||||
-- https://github.com/tpope/vim-fugitive
|
|
||||||
{ 'tpope/vim-fugitive' },
|
|
||||||
|
|
||||||
-- Git integration for buffers
|
-- Git integration for buffers
|
||||||
-- https://github.com/lewis6991/gitsigns.nvim
|
-- https://github.com/lewis6991/gitsigns.nvim
|
||||||
{
|
{
|
||||||
@@ -19,7 +15,7 @@ return {
|
|||||||
},
|
},
|
||||||
current_line_blame = false,
|
current_line_blame = false,
|
||||||
on_attach = function(bufnr)
|
on_attach = function(bufnr)
|
||||||
local gs = package.loaded.gitsigns
|
local gs = require 'gitsigns'
|
||||||
|
|
||||||
local function map(mode, l, r, opts)
|
local function map(mode, l, r, opts)
|
||||||
opts = opts or {}
|
opts = opts or {}
|
||||||
|
|||||||
@@ -2,6 +2,9 @@ return {
|
|||||||
-- A small Neovim plugin for previewing definitions using floating windows.
|
-- A small Neovim plugin for previewing definitions using floating windows.
|
||||||
-- https://github.com/rmagatti/goto-preview
|
-- https://github.com/rmagatti/goto-preview
|
||||||
'rmagatti/goto-preview',
|
'rmagatti/goto-preview',
|
||||||
|
dependencies = {
|
||||||
|
{ 'nvim-telescope/telescope.nvim' },
|
||||||
|
},
|
||||||
config = function()
|
config = function()
|
||||||
require('goto-preview').setup {
|
require('goto-preview').setup {
|
||||||
width = 120, -- Width of the floating window
|
width = 120, -- Width of the floating window
|
||||||
|
|||||||
@@ -1,254 +1,262 @@
|
|||||||
-- Quickstart configs for Nvim LSP
|
-- Quickstart configs for Nvim LSP
|
||||||
-- https://github.com/neovim/nvim-lspconfig
|
-- https://github.com/neovim/nvim-lspconfig
|
||||||
return {
|
return {
|
||||||
'neovim/nvim-lspconfig',
|
-- Neovim plugin to manage global and project-local settings
|
||||||
dependencies = {
|
-- Should be included before LSP Config
|
||||||
-- Automatically install LSPs to stdpath for neovim
|
-- https://github.com/folke/neoconf.nvim
|
||||||
'williamboman/mason.nvim',
|
{
|
||||||
'williamboman/mason-lspconfig.nvim',
|
'folke/neoconf.nvim',
|
||||||
'WhoIsSethDaniel/mason-tool-installer.nvim',
|
keys = {
|
||||||
-- Useful status updates for LSP
|
{ '<leader>?c', '<cmd>Neoconf<CR>', desc = 'Neoconf: Open' },
|
||||||
{
|
{ '<leader>?g', '<cmd>Neoconf global<CR>', desc = 'Neoconf: Global' },
|
||||||
'j-hui/fidget.nvim',
|
{ '<leader>?l', '<cmd>Neoconf local<CR>', desc = 'Neoconf: Local' },
|
||||||
opts = {
|
{ '<leader>?m', '<cmd>Neoconf lsp<CR>', desc = 'Neoconf: Show merged LSP config' },
|
||||||
notification = {
|
{ '<leader>?s', '<cmd>Neoconf show<CR>', desc = 'Neoconf: Show merged config' },
|
||||||
window = {
|
},
|
||||||
winblend = 50,
|
config = function()
|
||||||
align = 'top',
|
require('neoconf').setup()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
'neovim/nvim-lspconfig',
|
||||||
|
dependencies = {
|
||||||
|
-- Automatically install LSPs to stdpath for neovim
|
||||||
|
'williamboman/mason.nvim',
|
||||||
|
'williamboman/mason-lspconfig.nvim',
|
||||||
|
'WhoIsSethDaniel/mason-tool-installer.nvim',
|
||||||
|
-- Useful status updates for LSP
|
||||||
|
{
|
||||||
|
'j-hui/fidget.nvim',
|
||||||
|
opts = {
|
||||||
|
notification = {
|
||||||
|
window = {
|
||||||
|
winblend = 50,
|
||||||
|
align = 'top',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
'b0o/schemastore.nvim',
|
||||||
'b0o/schemastore.nvim',
|
{
|
||||||
{
|
-- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins
|
||||||
-- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins
|
-- used for completion, annotations and signatures of Neovim apis
|
||||||
-- used for completion, annotations and signatures of Neovim apis
|
'folke/lazydev.nvim',
|
||||||
'folke/lazydev.nvim',
|
dependencies = {
|
||||||
ft = 'lua',
|
-- `wezterm-types` provides types for the Wezterm terminal
|
||||||
opts = {
|
{
|
||||||
library = {
|
'justinsgithub/wezterm-types',
|
||||||
-- Load luvit types when the `vim.uv` word is found
|
as = 'wezterm',
|
||||||
{ path = 'luvit-meta/library', words = { 'vim%.uv' } },
|
},
|
||||||
|
},
|
||||||
|
ft = 'lua',
|
||||||
|
opts = {
|
||||||
|
library = {
|
||||||
|
-- Load luvit types when the `vim.uv` word is found
|
||||||
|
{ path = 'luvit-meta/library', words = { 'vim%.uv' } },
|
||||||
|
-- Load wezterm types when the `wezterm` word is found
|
||||||
|
{ path = 'wezterm-types', mods = { 'wezterm' } },
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
'folke/neoconf.nvim',
|
||||||
},
|
},
|
||||||
},
|
keys = {
|
||||||
config = function()
|
{ '<leader>do', '<cmd>lua vim.diagnostic.open_float()<CR>', desc = 'Diagnostic: Open float' },
|
||||||
-- Diagnostic keymaps
|
{ '<leader>dq', '<cmd>lua vim.diagnostic.setloclist()<CR>', desc = 'Diagnostic: Set loc list' },
|
||||||
vim.keymap.set('n', 'dp', vim.diagnostic.goto_prev, { desc = 'Diagnostic: Goto Prev' })
|
{ 'dn', '<cmd>lua vim.diagnostic.goto_next()<CR>', desc = 'Diagnostic: Goto Next' },
|
||||||
vim.keymap.set('n', 'dn', vim.diagnostic.goto_next, { desc = 'Diagnostic: Goto Next' })
|
{ 'dp', '<cmd>lua vim.diagnostic.goto_prev()<CR>', desc = 'Diagnostic: Goto Prev' },
|
||||||
vim.keymap.set('n', '<leader>do', vim.diagnostic.open_float, { desc = 'Diagnostic: Open float' })
|
{ '<leader>cr', '<cmd>lua vim.lsp.buf.rename()<CR>', desc = 'LSP: Rename' },
|
||||||
vim.keymap.set('n', '<leader>dq', vim.diagnostic.setloclist, { desc = 'Diagnostic: Set loc list' })
|
{ '<leader>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', desc = 'LSP: Code Action' },
|
||||||
|
{ 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', desc = 'LSP: Goto Definition' },
|
||||||
-- LSP settings.
|
{ 'gr', '<cmd>lua require("telescope.builtin").lsp_references()<CR>', desc = 'LSP: Goto References' },
|
||||||
-- This function gets run when an LSP connects to a particular buffer.
|
{ 'gI', '<cmd>lua vim.lsp.buf.implementation()<CR>', desc = 'LSP: Goto Implementation' },
|
||||||
local on_attach = function(_, bufnr)
|
{ '<leader>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', desc = 'LSP: Type Definition' },
|
||||||
local nmap = function(keys, func, desc)
|
{ '<leader>ds', '<cmd>lua require("telescope.builtin").lsp_document_symbols()<CR>', desc = 'LSP: Document Symbols' },
|
||||||
if desc then
|
{ '<leader>ws', '<cmd>lua require("telescope.builtin").lsp_dynamic_workspace_symbols()<CR>', desc = 'LSP: Workspace Symbols' },
|
||||||
desc = 'LSP: ' .. desc
|
{ 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', desc = 'LSP: Hover Documentation' },
|
||||||
end
|
{ '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', desc = 'LSP: Signature Documentation' },
|
||||||
|
{ 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', desc = 'LSP: Goto Declaration' },
|
||||||
vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc })
|
{ '<leader>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', desc = 'LSP: Workspace Add Folder' },
|
||||||
|
{ '<leader>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', desc = 'LSP: Workspace Remove Folder' },
|
||||||
|
{ '<leader>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', desc = 'LSP: Workspace List Folders' },
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
-- LSP settings.
|
||||||
|
-- This function gets run when an LSP connects to a particular buffer.
|
||||||
|
local on_attach = function(_, bufnr)
|
||||||
|
-- Create a command `:Format` local to the LSP buffer
|
||||||
|
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
|
||||||
|
if vim.lsp.buf.format then
|
||||||
|
vim.lsp.buf.format()
|
||||||
|
elseif vim.lsp.buf.formatting then
|
||||||
|
vim.lsp.buf.formatting()
|
||||||
|
end
|
||||||
|
end, { desc = 'Format current buffer with LSP' })
|
||||||
end
|
end
|
||||||
|
|
||||||
nmap('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
|
-- Setup mason so it can manage external tooling
|
||||||
nmap('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
|
require('mason').setup()
|
||||||
nmap('gd', vim.lsp.buf.definition, '[G]oto [D]efinition')
|
|
||||||
nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
|
|
||||||
nmap('gI', vim.lsp.buf.implementation, '[G]oto [I]mplementation')
|
|
||||||
nmap('<leader>D', vim.lsp.buf.type_definition, 'Type [D]efinition')
|
|
||||||
nmap('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
|
|
||||||
nmap('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
|
|
||||||
|
|
||||||
-- See `:help K` for why this keymap
|
-- Enable the following language servers
|
||||||
nmap('K', vim.lsp.buf.hover, 'Hover Documentation')
|
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
|
||||||
nmap('<C-k>', vim.lsp.buf.signature_help, 'Signature Documentation')
|
local servers = {
|
||||||
|
-- :help lspconfig-all for all pre-configured LSPs
|
||||||
|
ast_grep = {},
|
||||||
|
|
||||||
-- Lesser used LSP functionality
|
actionlint = {}, -- GitHub Actions
|
||||||
nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
ansiblels = {}, -- Ansible
|
||||||
nmap('<leader>wa', vim.lsp.buf.add_workspace_folder, '[W]orkspace [A]dd Folder')
|
bashls = {}, -- Bash
|
||||||
nmap('<leader>wr', vim.lsp.buf.remove_workspace_folder, '[W]orkspace [R]emove Folder')
|
css_variables = {}, -- CSS
|
||||||
nmap('<leader>wl', function()
|
cssls = {}, -- CSS
|
||||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
docker_compose_language_service = {}, -- Docker compose
|
||||||
end, '[W]orkspace [L]ist Folders')
|
dockerls = {}, -- Docker
|
||||||
|
eslint = {}, -- ESLint
|
||||||
|
gitlab_ci_ls = {}, -- GitLab CI
|
||||||
|
gopls = {}, -- Go
|
||||||
|
html = {}, -- HTML
|
||||||
|
intelephense = {}, -- PHP
|
||||||
|
pest_ls = {}, -- Pest (PHP)
|
||||||
|
phpactor = {}, -- PHP
|
||||||
|
psalm = {}, -- PHP
|
||||||
|
pyright = {}, -- Python
|
||||||
|
semgrep = {}, -- Security
|
||||||
|
shellcheck = {}, -- Shell scripts
|
||||||
|
shfmt = {}, -- Shell scripts formatting
|
||||||
|
stylelint_lsp = {}, -- Stylelint for S/CSS
|
||||||
|
stylua = {}, -- Used to format Lua code
|
||||||
|
tailwindcss = {}, -- Tailwind CSS
|
||||||
|
terraformls = {}, -- Terraform
|
||||||
|
tflint = {}, -- Terraform
|
||||||
|
ts_ls = {}, -- TypeScript/JS
|
||||||
|
typos_lsp = {}, -- Better writing
|
||||||
|
volar = {}, -- Vue
|
||||||
|
yamlls = {}, -- YAML
|
||||||
|
|
||||||
-- Create a command `:Format` local to the LSP buffer
|
lua_ls = {
|
||||||
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
|
settings = {
|
||||||
if vim.lsp.buf.format then
|
Lua = {
|
||||||
vim.lsp.buf.format()
|
completion = {
|
||||||
elseif vim.lsp.buf.formatting then
|
callSnippet = 'Replace',
|
||||||
vim.lsp.buf.formatting()
|
},
|
||||||
end
|
-- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings
|
||||||
end, { desc = 'Format current buffer with LSP' })
|
diagnostics = { disable = { 'missing-fields' } },
|
||||||
end
|
|
||||||
|
|
||||||
-- Setup mason so it can manage external tooling
|
|
||||||
require('mason').setup()
|
|
||||||
|
|
||||||
-- Enable the following language servers
|
|
||||||
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
|
|
||||||
local servers = {
|
|
||||||
-- :help lspconfig-all for all pre-configured LSPs
|
|
||||||
ast_grep = {},
|
|
||||||
|
|
||||||
actionlint = {}, -- GitHub Actions
|
|
||||||
ansiblels = {}, -- Ansible
|
|
||||||
bashls = {}, -- Bash
|
|
||||||
css_variables = {}, -- CSS
|
|
||||||
cssls = {}, -- CSS
|
|
||||||
docker_compose_language_service = {}, -- Docker compose
|
|
||||||
dockerls = {}, -- Docker
|
|
||||||
eslint = {}, -- ESLint
|
|
||||||
gitlab_ci_ls = {}, -- GitLab CI
|
|
||||||
gopls = {}, -- Go
|
|
||||||
grammarly = {}, -- Grammar and better writing
|
|
||||||
html = {}, -- HTML
|
|
||||||
intelephense = {}, -- PHP
|
|
||||||
jinja_lsp = {}, -- Jinja templates
|
|
||||||
pest_ls = {}, -- Pest (PHP)
|
|
||||||
phpactor = {}, -- PHP
|
|
||||||
psalm = {}, -- PHP
|
|
||||||
pyright = {}, -- Python
|
|
||||||
semgrep = {}, -- Security
|
|
||||||
shellcheck = {}, -- Shell scripts
|
|
||||||
shfmt = {}, -- Shell scripts formatting
|
|
||||||
stylelint_lsp = {}, -- Stylelint for S/CSS
|
|
||||||
stylua = {}, -- Used to format Lua code
|
|
||||||
tailwindcss = {}, -- Tailwind CSS
|
|
||||||
terraformls = {}, -- Terraform
|
|
||||||
tflint = {}, -- Terraform
|
|
||||||
ts_ls = {}, -- TypeScript/JS
|
|
||||||
typos_lsp = {}, -- Better writing
|
|
||||||
volar = {}, -- Vue
|
|
||||||
yamlls = {}, -- YAML
|
|
||||||
|
|
||||||
lua_ls = {
|
|
||||||
-- cmd = {...},
|
|
||||||
-- filetypes = { ...},
|
|
||||||
-- capabilities = {},
|
|
||||||
settings = {
|
|
||||||
Lua = {
|
|
||||||
completion = {
|
|
||||||
callSnippet = 'Replace',
|
|
||||||
},
|
},
|
||||||
-- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings
|
|
||||||
diagnostics = { disable = { 'missing-fields' } },
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
jsonls = {
|
||||||
jsonls = {
|
settings = {
|
||||||
settings = {
|
json = {
|
||||||
json = {
|
schemas = require('schemastore').json.schemas(),
|
||||||
schemas = require('schemastore').json.schemas(),
|
validate = { enable = true },
|
||||||
validate = { enable = true },
|
},
|
||||||
},
|
yaml = {
|
||||||
yaml = {
|
schemaStore = {
|
||||||
schemaStore = {
|
-- You must disable built-in schemaStore support if you want to use
|
||||||
-- You must disable built-in schemaStore support if you want to use
|
-- this plugin and its advanced options like `ignore`.
|
||||||
-- this plugin and its advanced options like `ignore`.
|
enable = false,
|
||||||
enable = false,
|
-- Avoid TypeError: Cannot read properties of undefined (reading 'length')
|
||||||
-- Avoid TypeError: Cannot read properties of undefined (reading 'length')
|
url = '',
|
||||||
url = '',
|
},
|
||||||
|
schemas = require('schemastore').yaml.schemas(),
|
||||||
},
|
},
|
||||||
schemas = require('schemastore').yaml.schemas(),
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
}
|
|
||||||
|
|
||||||
local ensure_installed = vim.tbl_keys(servers or {})
|
local ensure_installed = vim.tbl_keys(servers or {})
|
||||||
vim.list_extend(ensure_installed, {
|
vim.list_extend(ensure_installed, {
|
||||||
'actionlint',
|
'actionlint',
|
||||||
'ansible-language-server',
|
'ansible-language-server',
|
||||||
'ansible-lint',
|
'ansible-lint',
|
||||||
'bash-language-server',
|
'bash-language-server',
|
||||||
'blade-formatter',
|
'blade-formatter',
|
||||||
'codespell',
|
'commitlint',
|
||||||
'commitlint',
|
'diagnostic-languageserver',
|
||||||
'diagnostic-languageserver',
|
'docker-compose-language-service',
|
||||||
'docker-compose-language-service',
|
'dockerfile-language-server',
|
||||||
'dockerfile-language-server',
|
'editorconfig-checker',
|
||||||
'editorconfig-checker',
|
'fixjson',
|
||||||
'fixjson',
|
'flake8',
|
||||||
'flake8',
|
'html-lsp',
|
||||||
'html-lsp',
|
'jq',
|
||||||
'jq',
|
'jsonlint',
|
||||||
'jsonlint',
|
'luacheck',
|
||||||
'luacheck',
|
'php-cs-fixer',
|
||||||
'php-cs-fixer',
|
'phpcs',
|
||||||
'phpcs',
|
'phpmd',
|
||||||
'phpmd',
|
'semgrep',
|
||||||
'semgrep',
|
'shellcheck',
|
||||||
'shellcheck',
|
'shfmt',
|
||||||
'shfmt',
|
'stylelint',
|
||||||
'stylelint',
|
'stylua',
|
||||||
'stylua',
|
'yamllint',
|
||||||
'yamllint',
|
})
|
||||||
})
|
require('mason-tool-installer').setup {
|
||||||
require('mason-tool-installer').setup {
|
ensure_installed = ensure_installed,
|
||||||
ensure_installed = ensure_installed,
|
auto_update = true,
|
||||||
auto_update = true,
|
}
|
||||||
}
|
|
||||||
|
|
||||||
-- Ensure the servers above are installed
|
-- Ensure the servers above are installed
|
||||||
require('mason-lspconfig').setup {
|
require('mason-lspconfig').setup {
|
||||||
automatic_installation = true,
|
automatic_installation = true,
|
||||||
ensure_installed = servers,
|
ensure_installed = servers,
|
||||||
}
|
}
|
||||||
|
|
||||||
-- nvim-cmp supports additional completion capabilities
|
-- nvim-cmp supports additional completion capabilities
|
||||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
||||||
|
|
||||||
for _, lsp in ipairs(servers) do
|
for _, lsp in ipairs(servers) do
|
||||||
require('lspconfig')[lsp].setup {
|
require('lspconfig')[lsp].setup {
|
||||||
|
on_attach = on_attach,
|
||||||
|
capabilities = capabilities,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Turn on lsp status information
|
||||||
|
require('fidget').setup()
|
||||||
|
|
||||||
|
-- Example custom configuration for lua
|
||||||
|
--
|
||||||
|
-- Make runtime files discoverable to the server
|
||||||
|
local runtime_path = vim.split(package.path, ';')
|
||||||
|
table.insert(runtime_path, 'lua/?.lua')
|
||||||
|
table.insert(runtime_path, 'lua/?/init.lua')
|
||||||
|
|
||||||
|
require('lspconfig').lua_ls.setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
}
|
settings = {
|
||||||
end
|
Lua = {
|
||||||
|
runtime = {
|
||||||
-- Turn on lsp status information
|
-- Tell the language server which version of Lua you're using (most likely LuaJIT)
|
||||||
require('fidget').setup()
|
version = 'LuaJIT',
|
||||||
|
-- Setup your lua path
|
||||||
-- Example custom configuration for lua
|
path = runtime_path,
|
||||||
--
|
},
|
||||||
-- Make runtime files discoverable to the server
|
diagnostics = {
|
||||||
local runtime_path = vim.split(package.path, ';')
|
globals = { 'vim' },
|
||||||
table.insert(runtime_path, 'lua/?.lua')
|
},
|
||||||
table.insert(runtime_path, 'lua/?/init.lua')
|
workspace = {
|
||||||
|
library = vim.api.nvim_get_runtime_file('', true),
|
||||||
require('lspconfig').lua_ls.setup {
|
checkThirdParty = false,
|
||||||
on_attach = on_attach,
|
},
|
||||||
capabilities = capabilities,
|
-- Do not send telemetry data containing a randomized but unique identifier
|
||||||
settings = {
|
telemetry = { enable = false },
|
||||||
Lua = {
|
|
||||||
runtime = {
|
|
||||||
-- Tell the language server which version of Lua you're using (most likely LuaJIT)
|
|
||||||
version = 'LuaJIT',
|
|
||||||
-- Setup your lua path
|
|
||||||
path = runtime_path,
|
|
||||||
},
|
},
|
||||||
diagnostics = {
|
|
||||||
globals = { 'vim' },
|
|
||||||
},
|
|
||||||
workspace = {
|
|
||||||
library = vim.api.nvim_get_runtime_file('', true),
|
|
||||||
checkThirdParty = false,
|
|
||||||
},
|
|
||||||
-- Do not send telemetry data containing a randomized but unique identifier
|
|
||||||
telemetry = { enable = false },
|
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
}
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd('FileType', {
|
vim.api.nvim_create_autocmd('FileType', {
|
||||||
pattern = 'sh',
|
pattern = 'sh',
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.lsp.start {
|
vim.lsp.start {
|
||||||
name = 'bash-language-server',
|
name = 'bash-language-server',
|
||||||
cmd = { 'bash-language-server', 'start' },
|
cmd = { 'bash-language-server', 'start' },
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,10 @@
|
|||||||
-- https://github.com/nvim-lualine/lualine.nvim
|
-- https://github.com/nvim-lualine/lualine.nvim
|
||||||
return {
|
return {
|
||||||
'nvim-lualine/lualine.nvim',
|
'nvim-lualine/lualine.nvim',
|
||||||
|
dependencies = {
|
||||||
|
'kyazdani42/nvim-web-devicons',
|
||||||
|
'folke/noice.nvim',
|
||||||
|
},
|
||||||
config = function()
|
config = function()
|
||||||
require('lualine').setup {
|
require('lualine').setup {
|
||||||
options = {
|
options = {
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ return {
|
|||||||
},
|
},
|
||||||
cmd = 'Neotree',
|
cmd = 'Neotree',
|
||||||
keys = {
|
keys = {
|
||||||
{ '<leader>e', ':Neotree reveal<CR>', { desc = 'NeoTree reveal' } },
|
{ '<leader>e', ':Neotree reveal<CR>', desc = 'NeoTree reveal' },
|
||||||
},
|
},
|
||||||
opts = {
|
opts = {
|
||||||
close_if_last_window = true,
|
close_if_last_window = true,
|
||||||
|
|||||||
@@ -2,79 +2,83 @@ return {
|
|||||||
-- Highly experimental plugin that completely replaces the UI
|
-- Highly experimental plugin that completely replaces the UI
|
||||||
-- for messages, cmdline and the popupmenu.
|
-- for messages, cmdline and the popupmenu.
|
||||||
-- https://github.com/folke/noice.nvim
|
-- https://github.com/folke/noice.nvim
|
||||||
{
|
'folke/noice.nvim',
|
||||||
'folke/noice.nvim',
|
lazy = false,
|
||||||
dependencies = {
|
enabled = true,
|
||||||
'MunifTanjim/nui.nvim',
|
dependencies = {
|
||||||
-- A fancy, configurable, notification manager for NeoVim
|
'MunifTanjim/nui.nvim',
|
||||||
-- https://github.com/rcarriga/nvim-notify
|
-- A fancy, configurable, notification manager for NeoVim
|
||||||
{
|
-- https://github.com/rcarriga/nvim-notify
|
||||||
'rcarriga/nvim-notify',
|
'rcarriga/nvim-notify',
|
||||||
config = function()
|
'hrsh7th/nvim-cmp',
|
||||||
require('notify').setup {
|
|
||||||
background_colour = '#000000',
|
|
||||||
enabled = false,
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
setup = function()
|
|
||||||
vim.g.noice_ignored_filetypes = { 'fugitiveblame', 'fugitive', 'gitcommit' }
|
|
||||||
require('noice').setup {
|
|
||||||
-- you can enable a preset for easier configuration
|
|
||||||
presets = {
|
|
||||||
bottom_search = true, -- use a classic bottom cmdline for search
|
|
||||||
command_palette = true, -- position the cmdline and popupmenu together
|
|
||||||
long_message_to_split = true, -- long messages will be sent to a split
|
|
||||||
inc_rename = false, -- enables an input dialog for inc-rename.nvim
|
|
||||||
lsp_doc_border = false, -- add a border to hover docs and signature help
|
|
||||||
},
|
|
||||||
views = {
|
|
||||||
cmdline_popup = {
|
|
||||||
position = {
|
|
||||||
row = 5,
|
|
||||||
col = '50%',
|
|
||||||
},
|
|
||||||
size = {
|
|
||||||
width = 60,
|
|
||||||
height = 'auto',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
popupmenu = {
|
|
||||||
relative = 'editor',
|
|
||||||
position = {
|
|
||||||
row = 8,
|
|
||||||
col = '50%',
|
|
||||||
},
|
|
||||||
size = {
|
|
||||||
width = 60,
|
|
||||||
height = 10,
|
|
||||||
},
|
|
||||||
border = {
|
|
||||||
style = 'rounded',
|
|
||||||
padding = { 0, 1 },
|
|
||||||
},
|
|
||||||
win_options = {
|
|
||||||
winhighlight = { Normal = 'Normal', FloatBorder = 'DiagnosticInfo' },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
routes = {
|
|
||||||
{
|
|
||||||
filter = {
|
|
||||||
event = 'msg_show',
|
|
||||||
any = {
|
|
||||||
{ find = '%d+L, %d+B' },
|
|
||||||
{ find = '; after #%d+' },
|
|
||||||
{ find = '; before #%d+' },
|
|
||||||
{ find = '%d fewer lines' },
|
|
||||||
{ find = '%d more lines' },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
opts = { skip = true },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
|
keys = {
|
||||||
|
{ 'n', '<leader>tn', ':Noice dismiss<CR>', desc = 'Noice dismiss' },
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
vim.g.noice_ignored_filetypes = { 'fugitiveblame', 'fugitive', 'gitcommit', 'noice' }
|
||||||
|
require('noice').setup {
|
||||||
|
lsp = {
|
||||||
|
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
|
||||||
|
override = {
|
||||||
|
['vim.lsp.util.convert_input_to_markdown_lines'] = true,
|
||||||
|
['vim.lsp.util.stylize_markdown'] = true,
|
||||||
|
['cmp.entry.get_documentation'] = true, -- requires hrsh7th/nvim-cmp
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- you can enable a preset for easier configuration
|
||||||
|
presets = {
|
||||||
|
bottom_search = false, -- use a classic bottom cmdline for search
|
||||||
|
command_palette = true, -- position the cmdline and popupmenu together
|
||||||
|
long_message_to_split = true, -- long messages will be sent to a split
|
||||||
|
inc_rename = false, -- enables an input dialog for inc-rename.nvim
|
||||||
|
lsp_doc_border = false, -- add a border to hover docs and signature help
|
||||||
|
},
|
||||||
|
routes = {
|
||||||
|
{
|
||||||
|
filter = {
|
||||||
|
event = 'msg_show',
|
||||||
|
any = {
|
||||||
|
{ find = '%d+L, %d+B' },
|
||||||
|
{ find = '; after #%d+' },
|
||||||
|
{ find = '; before #%d+' },
|
||||||
|
{ find = '%d fewer lines' },
|
||||||
|
{ find = '%d more lines' },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
opts = { skip = true },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
views = {
|
||||||
|
cmdline_popup = {
|
||||||
|
position = {
|
||||||
|
row = 5,
|
||||||
|
col = '50%',
|
||||||
|
},
|
||||||
|
size = {
|
||||||
|
width = 60,
|
||||||
|
height = 'auto',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
popupmenu = {
|
||||||
|
relative = 'editor',
|
||||||
|
position = {
|
||||||
|
row = 8,
|
||||||
|
col = '50%',
|
||||||
|
},
|
||||||
|
size = {
|
||||||
|
width = 60,
|
||||||
|
height = 10,
|
||||||
|
},
|
||||||
|
border = {
|
||||||
|
style = 'rounded',
|
||||||
|
padding = { 0, 1 },
|
||||||
|
},
|
||||||
|
win_options = {
|
||||||
|
winhighlight = { Normal = 'Normal', FloatBorder = 'DiagnosticInfo' },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,9 +4,12 @@ return {
|
|||||||
{
|
{
|
||||||
'nvim-telescope/telescope.nvim',
|
'nvim-telescope/telescope.nvim',
|
||||||
version = '*',
|
version = '*',
|
||||||
|
lazy = false,
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{ 'nvim-lua/plenary.nvim' },
|
{ 'nvim-lua/plenary.nvim' },
|
||||||
{ 'nvim-telescope/telescope-symbols.nvim' },
|
{ 'nvim-telescope/telescope-symbols.nvim' },
|
||||||
|
{ 'folke/which-key.nvim' },
|
||||||
|
{ 'ThePrimeagen/harpoon' },
|
||||||
|
|
||||||
-- Fuzzy Finder Algorithm which requires local dependencies to be built.
|
-- Fuzzy Finder Algorithm which requires local dependencies to be built.
|
||||||
-- Only load if `make` is available
|
-- Only load if `make` is available
|
||||||
@@ -16,13 +19,10 @@ return {
|
|||||||
cond = vim.fn.executable 'make' == 1,
|
cond = vim.fn.executable 'make' == 1,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
setup = function()
|
config = function()
|
||||||
local t = require 'telescope'
|
local t = require 'telescope'
|
||||||
local a = require 'telescope.actions'
|
local a = require 'telescope.actions'
|
||||||
local b = require 'telescope.builtin'
|
|
||||||
local themes = require 'telescope.themes'
|
local themes = require 'telescope.themes'
|
||||||
require('telescope').load_extension 'harpoon'
|
|
||||||
t.load_extension 'git_worktree'
|
|
||||||
|
|
||||||
-- [[ Configure Telescope ]]
|
-- [[ Configure Telescope ]]
|
||||||
-- See `:help telescope` and `:help telescope.setup()`
|
-- See `:help telescope` and `:help telescope.setup()`
|
||||||
@@ -54,11 +54,34 @@ return {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- Load extensions
|
||||||
|
pcall(t.load_extension, 'harpoon')
|
||||||
|
pcall(t.load_extension, 'git_worktree')
|
||||||
-- Enable telescope fzf native, if installed
|
-- Enable telescope fzf native, if installed
|
||||||
pcall(t.load_extension, 'fzf')
|
pcall(t.load_extension, 'fzf')
|
||||||
|
|
||||||
|
-- [[ Telescope Keymaps ]]
|
||||||
-- See `:help telescope.builtin`
|
-- See `:help telescope.builtin`
|
||||||
vim.keymap.set('n', '<leader>so', b.oldfiles, { desc = '[?] Find recently opened files' })
|
-- See `:help telescope.keymap`
|
||||||
|
local b = require 'telescope.builtin'
|
||||||
|
|
||||||
|
local wk = require 'which-key'
|
||||||
|
wk.add {
|
||||||
|
-- { '<leader><space>', b.buffers, desc = '[ ] Find existing buffers' },
|
||||||
|
{ '<leader>gR', "<cmd>lua require('telescope').extensions.git_worktree.create_git_worktree()<CR>", desc = 'Create Git worktree' },
|
||||||
|
{ '<leader>gr', "<cmd>lua require('telescope').extensions.git_worktree.git_worktrees()<CR>", desc = 'Git worktrees' },
|
||||||
|
{ '<leader>sS', b.git_status, desc = '' },
|
||||||
|
{ '<leader>sd', b.diagnostics, desc = '[S]earch [D]iagnostics' },
|
||||||
|
{ '<leader>sf', b.find_files, desc = '[S]earch [F]iles' },
|
||||||
|
{ '<leader>sg', b.live_grep, desc = '[S]earch by [G]rep' },
|
||||||
|
{ '<leader>sm', ':Telescope harpoon marks<CR>', desc = 'Harpoon Marks' },
|
||||||
|
{ '<leader>sn', "<cmd>lua require('telescope').extensions.notify.notify()<CR>", desc = 'Notify' },
|
||||||
|
{ '<leader>so', b.oldfiles, desc = '[?] Find recently opened files' },
|
||||||
|
{ '<leader>sw', b.grep_string, desc = '[S]earch current [W]ord' },
|
||||||
|
{ '<leader>st', ':TodoTelescope<CR>', desc = 'Telescope: Todo' },
|
||||||
|
{ '<leader><tab>', "<Cmd>lua require('telescope.builtin').commands()<CR>", desc = 'Telescope: Commands' },
|
||||||
|
}
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>/', function()
|
vim.keymap.set('n', '<leader>/', function()
|
||||||
-- You can pass additional configuration to telescope to change theme, layout, etc.
|
-- You can pass additional configuration to telescope to change theme, layout, etc.
|
||||||
b.current_buffer_fuzzy_find(themes.get_dropdown {
|
b.current_buffer_fuzzy_find(themes.get_dropdown {
|
||||||
@@ -66,20 +89,6 @@ return {
|
|||||||
previewer = true,
|
previewer = true,
|
||||||
})
|
})
|
||||||
end, { desc = '[/] Fuzzily search in current buffer]' })
|
end, { desc = '[/] Fuzzily search in current buffer]' })
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>sf', b.find_files, { desc = '[S]earch [F]iles' })
|
|
||||||
vim.keymap.set('n', '<leader>sw', b.grep_string, { desc = '[S]earch current [W]ord' })
|
|
||||||
vim.keymap.set('n', '<leader>sg', b.live_grep, { desc = '[S]earch by [G]rep' })
|
|
||||||
vim.keymap.set('n', '<leader>sd', b.diagnostics, { desc = '[S]earch [D]iagnostics' })
|
|
||||||
vim.keymap.set('n', '<leader>sb', b.buffers, { desc = '[ ] Find existing buffers' })
|
|
||||||
vim.keymap.set('n', '<leader>sS', b.git_status, { desc = '' })
|
|
||||||
vim.keymap.set('n', '<leader>sm', ':Telescope harpoon marks<CR>', { desc = 'Harpoon [M]arks' })
|
|
||||||
vim.keymap.set('n', '<Leader>sr', "<CMD>lua require('telescope').extensions.git_worktree.git_worktrees()<CR>")
|
|
||||||
vim.keymap.set('n', '<Leader>sR', "<CMD>lua require('telescope').extensions.git_worktree.create_git_worktree()<CR>")
|
|
||||||
vim.keymap.set('n', '<Leader>sn', "<CMD>lua require('telescope').extensions.notify.notify()<CR>")
|
|
||||||
|
|
||||||
vim.api.nvim_set_keymap('n', 'st', ':TodoTelescope<CR>', { noremap = true })
|
|
||||||
vim.api.nvim_set_keymap('n', '<Leader><tab>', "<Cmd>lua require('telescope.builtin').commands()<CR>", { noremap = false })
|
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,12 +9,17 @@ return {
|
|||||||
auto_close = true,
|
auto_close = true,
|
||||||
use_lsp_diagnostic_signs = true,
|
use_lsp_diagnostic_signs = true,
|
||||||
}
|
}
|
||||||
vim.keymap.set('n', '<leader>xx', '<cmd>TroubleToggle<cr>', { silent = true, noremap = true })
|
|
||||||
vim.keymap.set('n', '<leader>xw', '<cmd>TroubleToggle workspace_diagnostics<cr>', { silent = true, noremap = true })
|
-- Keybindings
|
||||||
vim.keymap.set('n', '<leader>xd', '<cmd>TroubleToggle document_diagnostics<cr>', { silent = true, noremap = true })
|
local wk = require 'which-key'
|
||||||
vim.keymap.set('n', '<leader>xl', '<cmd>TroubleToggle loclist<cr>', { silent = true, noremap = true })
|
wk.add {
|
||||||
vim.keymap.set('n', '<leader>xq', '<cmd>TroubleToggle quickfix<cr>', { silent = true, noremap = true })
|
{ '<leader>xx', '<cmd>TroubleToggle<cr>', desc = 'Toggle Trouble' },
|
||||||
vim.keymap.set('n', 'gR', '<cmd>TroubleToggle lsp_references<cr>', { silent = true, noremap = true })
|
{ '<leader>xw', '<cmd>TroubleToggle workspace_diagnostics<cr>', desc = 'Toggle Workspace Diagnostics' },
|
||||||
|
{ '<leader>xd', '<cmd>TroubleToggle document_diagnostics<cr>', desc = 'Toggle Document Diagnostics' },
|
||||||
|
{ '<leader>xl', '<cmd>TroubleToggle loclist<cr>', desc = 'Toggle Loclist' },
|
||||||
|
{ '<leader>xq', '<cmd>TroubleToggle quickfix<cr>', desc = 'Toggle Quickfix' },
|
||||||
|
{ 'gR', '<cmd>TroubleToggle lsp_references<cr>', desc = 'Toggle LSP References' },
|
||||||
|
}
|
||||||
|
|
||||||
-- Diagnostic signs
|
-- Diagnostic signs
|
||||||
-- https://github.com/folke/trouble.nvim/issues/52
|
-- https://github.com/folke/trouble.nvim/issues/52
|
||||||
|
|||||||
@@ -39,6 +39,9 @@ return {
|
|||||||
{
|
{
|
||||||
'folke/twilight.nvim',
|
'folke/twilight.nvim',
|
||||||
ft = 'markdown', -- Highlight markdown files
|
ft = 'markdown', -- Highlight markdown files
|
||||||
|
keys = {
|
||||||
|
{ 'n', 'tw', '<cmd>Twilight<cr>', desc = 'Twilight' },
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Seamless navigation between tmux panes and vim splits
|
-- Seamless navigation between tmux panes and vim splits
|
||||||
@@ -55,11 +58,11 @@ return {
|
|||||||
'TmuxNavigatePrevious',
|
'TmuxNavigatePrevious',
|
||||||
},
|
},
|
||||||
keys = {
|
keys = {
|
||||||
{ '<c-h>', '<cmd><C-U>TmuxNavigateLeft<cr>' },
|
{ '<c-h>', '<cmd><C-U>TmuxNavigateLeft<cr>', desc = 'tmux: Navigate Left' },
|
||||||
{ '<c-j>', '<cmd><C-U>TmuxNavigateDown<cr>' },
|
{ '<c-j>', '<cmd><C-U>TmuxNavigateDown<cr>', desc = 'tmux: Navigate Down' },
|
||||||
{ '<c-k>', '<cmd><C-U>TmuxNavigateUp<cr>' },
|
{ '<c-k>', '<cmd><C-U>TmuxNavigateUp<cr>', desc = 'tmux: Navigate Up' },
|
||||||
{ '<c-l>', '<cmd><C-U>TmuxNavigateRight<cr>' },
|
{ '<c-l>', '<cmd><C-U>TmuxNavigateRight<cr>', desc = 'tmux: Navigate Right' },
|
||||||
{ '<c-\\>', '<cmd><C-U>TmuxNavigatePrevious<cr>' },
|
{ '<c-\\>', '<cmd><C-U>TmuxNavigatePrevious<cr>', desc = 'tmux: Navigate Previous' },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
-- Cloak allows you to overlay *'s over defined patterns in defined files.
|
-- Cloak allows you to overlay *'s over defined patterns in defined files.
|
||||||
@@ -127,11 +130,11 @@ return {
|
|||||||
|
|
||||||
wk.add {
|
wk.add {
|
||||||
{ '<leader>cb', group = 'CommentBox' },
|
{ '<leader>cb', group = 'CommentBox' },
|
||||||
{ '<Leader>cbt', '<Cmd>CBccbox<CR>', desc = 'CommentBox: Box Title' },
|
{ '<leader>cbb', '<Cmd>CBccbox<CR>', desc = 'CommentBox: Box Title' },
|
||||||
{ '<Leader>cbd', '<Cmd>CBd<CR>', desc = 'Remove a box' },
|
{ '<leader>cbd', '<Cmd>CBd<CR>', desc = 'CommentBox: Remove a box' },
|
||||||
{ '<Leader>cbl', '<Cmd>CBline<CR>', desc = 'CommentBox: Simple Line' },
|
{ '<leader>cbl', '<Cmd>CBline<CR>', desc = 'CommentBox: Simple Line' },
|
||||||
{ '<Leader>cbm', '<Cmd>CBllbox14<CR>', desc = 'CommentBox: Marked' },
|
{ '<leader>cbm', '<Cmd>CBllbox14<CR>', desc = 'CommentBox: Marked' },
|
||||||
{ '<Leader>cbt', '<Cmd>CBllline<CR>', desc = 'CommentBox: Titled Line' },
|
{ '<leader>cbt', '<Cmd>CBllline<CR>', desc = 'CommentBox: Titled Line' },
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user