mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-12 16:52:37 +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,6 +1,24 @@
|
|||||||
-- 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 plugin to manage global and project-local settings
|
||||||
|
-- Should be included before LSP Config
|
||||||
|
-- https://github.com/folke/neoconf.nvim
|
||||||
|
{
|
||||||
|
'folke/neoconf.nvim',
|
||||||
|
keys = {
|
||||||
|
{ '<leader>?c', '<cmd>Neoconf<CR>', desc = 'Neoconf: Open' },
|
||||||
|
{ '<leader>?g', '<cmd>Neoconf global<CR>', desc = 'Neoconf: Global' },
|
||||||
|
{ '<leader>?l', '<cmd>Neoconf local<CR>', desc = 'Neoconf: Local' },
|
||||||
|
{ '<leader>?m', '<cmd>Neoconf lsp<CR>', desc = 'Neoconf: Show merged LSP config' },
|
||||||
|
{ '<leader>?s', '<cmd>Neoconf show<CR>', desc = 'Neoconf: Show merged config' },
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require('neoconf').setup()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
'neovim/nvim-lspconfig',
|
'neovim/nvim-lspconfig',
|
||||||
dependencies = {
|
dependencies = {
|
||||||
-- Automatically install LSPs to stdpath for neovim
|
-- Automatically install LSPs to stdpath for neovim
|
||||||
@@ -24,54 +42,49 @@ return {
|
|||||||
-- `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 = {
|
||||||
|
-- `wezterm-types` provides types for the Wezterm terminal
|
||||||
|
{
|
||||||
|
'justinsgithub/wezterm-types',
|
||||||
|
as = 'wezterm',
|
||||||
|
},
|
||||||
|
},
|
||||||
ft = 'lua',
|
ft = 'lua',
|
||||||
opts = {
|
opts = {
|
||||||
library = {
|
library = {
|
||||||
-- Load luvit types when the `vim.uv` word is found
|
-- Load luvit types when the `vim.uv` word is found
|
||||||
{ path = 'luvit-meta/library', words = { 'vim%.uv' } },
|
{ 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 = {
|
||||||
|
{ '<leader>do', '<cmd>lua vim.diagnostic.open_float()<CR>', desc = 'Diagnostic: Open float' },
|
||||||
|
{ '<leader>dq', '<cmd>lua vim.diagnostic.setloclist()<CR>', desc = 'Diagnostic: Set loc list' },
|
||||||
|
{ 'dn', '<cmd>lua vim.diagnostic.goto_next()<CR>', desc = 'Diagnostic: Goto Next' },
|
||||||
|
{ 'dp', '<cmd>lua vim.diagnostic.goto_prev()<CR>', desc = 'Diagnostic: Goto Prev' },
|
||||||
|
{ '<leader>cr', '<cmd>lua vim.lsp.buf.rename()<CR>', desc = 'LSP: Rename' },
|
||||||
|
{ '<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' },
|
||||||
|
{ 'gr', '<cmd>lua require("telescope.builtin").lsp_references()<CR>', desc = 'LSP: Goto References' },
|
||||||
|
{ 'gI', '<cmd>lua vim.lsp.buf.implementation()<CR>', desc = 'LSP: Goto Implementation' },
|
||||||
|
{ '<leader>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', desc = 'LSP: Type Definition' },
|
||||||
|
{ '<leader>ds', '<cmd>lua require("telescope.builtin").lsp_document_symbols()<CR>', desc = 'LSP: Document Symbols' },
|
||||||
|
{ '<leader>ws', '<cmd>lua require("telescope.builtin").lsp_dynamic_workspace_symbols()<CR>', desc = 'LSP: Workspace Symbols' },
|
||||||
|
{ 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', desc = 'LSP: Hover Documentation' },
|
||||||
|
{ '<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' },
|
||||||
|
{ '<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()
|
config = function()
|
||||||
-- Diagnostic keymaps
|
|
||||||
vim.keymap.set('n', 'dp', vim.diagnostic.goto_prev, { desc = 'Diagnostic: Goto Prev' })
|
|
||||||
vim.keymap.set('n', 'dn', vim.diagnostic.goto_next, { desc = 'Diagnostic: Goto Next' })
|
|
||||||
vim.keymap.set('n', '<leader>do', vim.diagnostic.open_float, { desc = 'Diagnostic: Open float' })
|
|
||||||
vim.keymap.set('n', '<leader>dq', vim.diagnostic.setloclist, { desc = 'Diagnostic: Set loc list' })
|
|
||||||
|
|
||||||
-- LSP settings.
|
-- LSP settings.
|
||||||
-- This function gets run when an LSP connects to a particular buffer.
|
-- This function gets run when an LSP connects to a particular buffer.
|
||||||
local on_attach = function(_, bufnr)
|
local on_attach = function(_, bufnr)
|
||||||
local nmap = function(keys, func, desc)
|
|
||||||
if desc then
|
|
||||||
desc = 'LSP: ' .. desc
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc })
|
|
||||||
end
|
|
||||||
|
|
||||||
nmap('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
|
|
||||||
nmap('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
|
|
||||||
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
|
|
||||||
nmap('K', vim.lsp.buf.hover, 'Hover Documentation')
|
|
||||||
nmap('<C-k>', vim.lsp.buf.signature_help, 'Signature Documentation')
|
|
||||||
|
|
||||||
-- Lesser used LSP functionality
|
|
||||||
nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
|
||||||
nmap('<leader>wa', vim.lsp.buf.add_workspace_folder, '[W]orkspace [A]dd Folder')
|
|
||||||
nmap('<leader>wr', vim.lsp.buf.remove_workspace_folder, '[W]orkspace [R]emove Folder')
|
|
||||||
nmap('<leader>wl', function()
|
|
||||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
|
||||||
end, '[W]orkspace [L]ist Folders')
|
|
||||||
|
|
||||||
-- Create a command `:Format` local to the LSP buffer
|
-- Create a command `:Format` local to the LSP buffer
|
||||||
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
|
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
|
||||||
if vim.lsp.buf.format then
|
if vim.lsp.buf.format then
|
||||||
@@ -101,10 +114,8 @@ return {
|
|||||||
eslint = {}, -- ESLint
|
eslint = {}, -- ESLint
|
||||||
gitlab_ci_ls = {}, -- GitLab CI
|
gitlab_ci_ls = {}, -- GitLab CI
|
||||||
gopls = {}, -- Go
|
gopls = {}, -- Go
|
||||||
grammarly = {}, -- Grammar and better writing
|
|
||||||
html = {}, -- HTML
|
html = {}, -- HTML
|
||||||
intelephense = {}, -- PHP
|
intelephense = {}, -- PHP
|
||||||
jinja_lsp = {}, -- Jinja templates
|
|
||||||
pest_ls = {}, -- Pest (PHP)
|
pest_ls = {}, -- Pest (PHP)
|
||||||
phpactor = {}, -- PHP
|
phpactor = {}, -- PHP
|
||||||
psalm = {}, -- PHP
|
psalm = {}, -- PHP
|
||||||
@@ -123,9 +134,6 @@ return {
|
|||||||
yamlls = {}, -- YAML
|
yamlls = {}, -- YAML
|
||||||
|
|
||||||
lua_ls = {
|
lua_ls = {
|
||||||
-- cmd = {...},
|
|
||||||
-- filetypes = { ...},
|
|
||||||
-- capabilities = {},
|
|
||||||
settings = {
|
settings = {
|
||||||
Lua = {
|
Lua = {
|
||||||
completion = {
|
completion = {
|
||||||
@@ -163,7 +171,6 @@ return {
|
|||||||
'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',
|
||||||
@@ -251,4 +258,5 @@ return {
|
|||||||
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,33 +2,53 @@ 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,
|
||||||
|
enabled = true,
|
||||||
dependencies = {
|
dependencies = {
|
||||||
'MunifTanjim/nui.nvim',
|
'MunifTanjim/nui.nvim',
|
||||||
-- A fancy, configurable, notification manager for NeoVim
|
-- A fancy, configurable, notification manager for NeoVim
|
||||||
-- https://github.com/rcarriga/nvim-notify
|
-- https://github.com/rcarriga/nvim-notify
|
||||||
{
|
|
||||||
'rcarriga/nvim-notify',
|
'rcarriga/nvim-notify',
|
||||||
|
'hrsh7th/nvim-cmp',
|
||||||
|
},
|
||||||
|
keys = {
|
||||||
|
{ 'n', '<leader>tn', ':Noice dismiss<CR>', desc = 'Noice dismiss' },
|
||||||
|
},
|
||||||
config = function()
|
config = function()
|
||||||
require('notify').setup {
|
vim.g.noice_ignored_filetypes = { 'fugitiveblame', 'fugitive', 'gitcommit', 'noice' }
|
||||||
background_colour = '#000000',
|
|
||||||
enabled = false,
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
setup = function()
|
|
||||||
vim.g.noice_ignored_filetypes = { 'fugitiveblame', 'fugitive', 'gitcommit' }
|
|
||||||
require('noice').setup {
|
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
|
-- you can enable a preset for easier configuration
|
||||||
presets = {
|
presets = {
|
||||||
bottom_search = true, -- use a classic bottom cmdline for search
|
bottom_search = false, -- use a classic bottom cmdline for search
|
||||||
command_palette = true, -- position the cmdline and popupmenu together
|
command_palette = true, -- position the cmdline and popupmenu together
|
||||||
long_message_to_split = true, -- long messages will be sent to a split
|
long_message_to_split = true, -- long messages will be sent to a split
|
||||||
inc_rename = false, -- enables an input dialog for inc-rename.nvim
|
inc_rename = false, -- enables an input dialog for inc-rename.nvim
|
||||||
lsp_doc_border = false, -- add a border to hover docs and signature help
|
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 = {
|
views = {
|
||||||
cmdline_popup = {
|
cmdline_popup = {
|
||||||
position = {
|
position = {
|
||||||
@@ -59,22 +79,6 @@ return {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
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,
|
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