From ec3540565a2f419d02a206f0a3bd2888429eb281 Mon Sep 17 00:00:00 2001 From: FollieHiyuki Date: Wed, 14 Jul 2021 16:23:24 +0300 Subject: [PATCH] neovim: add lspkind and nnn.vim --- home/.config/nvim/lua/mappings.lua | 6 ++++-- home/.config/nvim/lua/modules/lsp.lua | 8 ++++---- home/.config/nvim/lua/modules/picker.lua | 13 +++++++++++++ home/.config/nvim/lua/modules/statusline.lua | 2 +- home/.config/nvim/lua/plugins.lua | 17 ++++++++++++++++- 5 files changed, 38 insertions(+), 8 deletions(-) create mode 100644 home/.config/nvim/lua/modules/picker.lua diff --git a/home/.config/nvim/lua/mappings.lua b/home/.config/nvim/lua/mappings.lua index 6a631b0..ef56b4f 100644 --- a/home/.config/nvim/lua/mappings.lua +++ b/home/.config/nvim/lua/mappings.lua @@ -113,10 +113,11 @@ wk.register({ -- Normal mode (with leader key) -- ----------------------------------- wk.register({ - c = {':ColorizerToggle', 'Toggle colorizer'}, - b = { name = 'Buffer', + c = {':ColorizerToggle', 'Colorizer'}, + d = {':bdelete', 'Close buffer'}, + f = {':NnnPicker %:p:h', 'File picker'}, n = {':DashboardNewFile', 'New file'} }, @@ -195,6 +196,7 @@ wk.register({ -- Tab related t = { name = 'Tab', + c = {'tabclose', 'Close tab'}, n = {'tabnext', 'Next tab'}, p = {'tabprev', 'Previous tab'}, t = {'tabnew', 'New tab'} diff --git a/home/.config/nvim/lua/modules/lsp.lua b/home/.config/nvim/lua/modules/lsp.lua index ccee143..7e87233 100644 --- a/home/.config/nvim/lua/modules/lsp.lua +++ b/home/.config/nvim/lua/modules/lsp.lua @@ -120,7 +120,7 @@ for _, server in ipairs(servers) do end -- Replace the default lsp diagnostic letters with prettier symbols --- vim.fn.sign_define('LspDiagnosticsSignError', {text = '', numhl = 'LspDiagnosticsDefaultError'}) --- vim.fn.sign_define('LspDiagnosticsSignWarning', {text = '', numhl = 'LspDiagnosticsDefaultWarning'}) --- vim.fn.sign_define('LspDiagnosticsSignInformation', {text = '', numhl = 'LspDiagnosticsDefaultInformation'}) --- vim.fn.sign_define('LspDiagnosticsSignHint', {text = '', numhl = 'LspDiagnosticsDefaultHint'}) +vim.fn.sign_define('LspDiagnosticsSignError', {text = ''}) +vim.fn.sign_define('LspDiagnosticsSignWarning', {text = ''}) +vim.fn.sign_define('LspDiagnosticsSignInformation', {text = ''}) +vim.fn.sign_define('LspDiagnosticsSignHint', {text = ''}) diff --git a/home/.config/nvim/lua/modules/picker.lua b/home/.config/nvim/lua/modules/picker.lua new file mode 100644 index 0000000..af5f53a --- /dev/null +++ b/home/.config/nvim/lua/modules/picker.lua @@ -0,0 +1,13 @@ +return require('nnn').setup { + set_default_mappings = false, + session = 'global', + layout = { + window = { width = 0.8, height = 0.8, highlight = 'Debug' }, + }, + command = 'nnn -HUdex', + action = { + [''] = 'tab split', + [''] = 'split', + [''] = 'vsplit' + } +} diff --git a/home/.config/nvim/lua/modules/statusline.lua b/home/.config/nvim/lua/modules/statusline.lua index 2daf4da..bb0a88c 100644 --- a/home/.config/nvim/lua/modules/statusline.lua +++ b/home/.config/nvim/lua/modules/statusline.lua @@ -107,7 +107,7 @@ gls.left[9] = { gls.left[10] = { DiagnosticHint = { provider = 'DiagnosticHint', - icon = '  ', + icon = '  ', highlight = {colors.cyan, colors.grey1} } } diff --git a/home/.config/nvim/lua/plugins.lua b/home/.config/nvim/lua/plugins.lua index efd01fb..2606fa2 100644 --- a/home/.config/nvim/lua/plugins.lua +++ b/home/.config/nvim/lua/plugins.lua @@ -126,6 +126,13 @@ return require('packer').startup( require('modules.lsp') end } + use { + 'onsails/lspkind-nvim', + event = 'BufRead', + config = function() + require('lspkind').init({with_text = false}) + end + } use { 'hrsh7th/nvim-compe', event = 'InsertEnter', @@ -290,7 +297,15 @@ return require('packer').startup( } -- Just for benchmarking use {'tweekmonster/startuptime.vim', cmd = 'StartupTime'} + -- File picker, since Telescope file browser doesn't support dotfiles + use { + 'mcchrish/nnn.vim', + cmd = 'NnnPicker', + config = function() + require('modules.picker') + end + } - -- TODO: trouble.nvim, lspsaga, orgmode.nvim, lspkind, TrueZen/zen-mode, nvim-lint, vim-spectre, nvim-dap, hop.nvim, dial.nvim, asynctasks.nvim + -- TODO: trouble.nvim, lspsaga, orgmode.nvim, TrueZen/zen-mode, nvim-lint, vim-spectre, nvim-dap, hop.nvim, dial.nvim, asynctasks.nvim end )