From f421c9f95d74f05a35457fdfce4fd95565877f12 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sat, 20 Nov 2021 22:24:07 +0100 Subject: Updated project-open to use $TERMINAL and changing the variable to alacritty --- config/nvim/lua/plugins.lua | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'config/nvim/lua/plugins.lua') diff --git a/config/nvim/lua/plugins.lua b/config/nvim/lua/plugins.lua index 1d5d0b4..05712a6 100644 --- a/config/nvim/lua/plugins.lua +++ b/config/nvim/lua/plugins.lua @@ -1,4 +1,4 @@ -vim.cmd [[packadd packer.nvim]] +vim.cmd [[ packadd packer.nvim ]] return require('packer').startup(function() use 'wbthomason/packer.nvim' -- plugin manager (can manage itself) @@ -30,4 +30,17 @@ return require('packer').startup(function() {'kyazdani42/nvim-web-devicons', opt = true}, } } + -- todos,fix,etc.. highlight and list + use { + 'folke/todo-comments.nvim', + requires = 'nvim-lua/plenary.nvim', + config = function() + print("plugins") + require('todo-comments').setup { + } + end + } end) + +-- TODO: bonjour +-- FIX: bonjour -- cgit From 3ab16167f2035aa7f4313a081d89d691161831b9 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sat, 20 Nov 2021 22:33:41 +0100 Subject: Added neovim todo-comments plugins to highlight and list todos --- config/nvim/lua/plugins.lua | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'config/nvim/lua/plugins.lua') diff --git a/config/nvim/lua/plugins.lua b/config/nvim/lua/plugins.lua index 05712a6..c1c9bf3 100644 --- a/config/nvim/lua/plugins.lua +++ b/config/nvim/lua/plugins.lua @@ -35,12 +35,9 @@ return require('packer').startup(function() 'folke/todo-comments.nvim', requires = 'nvim-lua/plenary.nvim', config = function() - print("plugins") require('todo-comments').setup { + signs = false } end } end) - --- TODO: bonjour --- FIX: bonjour -- cgit From e248ebefcecc82f3b12da4ea0b3b8efd34252779 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sat, 20 Nov 2021 22:46:20 +0100 Subject: Moved nvim plugins config in plugins.lua file, Switching to comments.nvim since the other one add a bug with blank lines --- config/nvim/lua/plugins.lua | 75 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 70 insertions(+), 5 deletions(-) (limited to 'config/nvim/lua/plugins.lua') diff --git a/config/nvim/lua/plugins.lua b/config/nvim/lua/plugins.lua index c1c9bf3..7356e43 100644 --- a/config/nvim/lua/plugins.lua +++ b/config/nvim/lua/plugins.lua @@ -2,7 +2,6 @@ vim.cmd [[ packadd packer.nvim ]] return require('packer').startup(function() use 'wbthomason/packer.nvim' -- plugin manager (can manage itself) - use 'terrortylor/nvim-comment' -- comments use 'junegunn/vim-easy-align' -- align use 'AndrewRadev/sideways.vim' -- Move arguments sideways use 'FooSoft/vim-argwrap' -- Put arguments on multiple lines @@ -10,17 +9,67 @@ return require('packer').startup(function() use 'romainl/vim-cool' -- only highlight search matches when searching use 'neovim/nvim-lspconfig' -- nvim lsp configuration + use { + 'numToStr/Comment.nvim', + config = function() + require('Comment').setup() + end + } + -- color scheme - use {'ellisonleao/gruvbox.nvim', requires = {'rktjmp/lush.nvim'}} + use { + 'ellisonleao/gruvbox.nvim', + requires = {'rktjmp/lush.nvim'}, + config = function() + vim.opt.termguicolors = true + vim.opt.background = "dark" + vim.cmd [[ colorscheme gruvbox ]] + vim.g.gruvbox_italic = 1 + vim.g.gruvbox_bold = 1 + vim.g.gruvbox_termcolors = 256 + vim.g.gruvbox_contrast_dark = 'medium' + vim.g.gruvbox_contrast_light = 'hard' + vim.g.gruvbox_invert_selection = 0 + end + } -- status line use { 'nvim-lualine/lualine.nvim', - requires = {'kyazdani42/nvim-web-devicons', opt = true} + requires = {'kyazdani42/nvim-web-devicons', opt = true}, + config = function() + require('lualine').setup { + options = { + theme = 'gruvbox', + icons_enabled = true, + section_separators = '', + component_separators = '' + } + } + end } -- better syntax highlight for everything use { 'nvim-treesitter/nvim-treesitter', - run = ':TSUpdate' + run = ':TSUpdate', + config = function() + require('nvim-treesitter.configs').setup { + highlight = { + enable = true + }, + -- indent = { enable = true }, + -- TODO: could be neat + -- incremental_selection = { + -- enable = true, + -- keymaps = { + -- init_selection = "gnn", + -- node_incremental = "grn", + -- scope_incremental = "grc", + -- node_decremental = "grm", + -- } + -- } + } + vim.cmd [[ highlight link pythonTSKeywordOperator Keyword ]] + end } -- fuzzy finder (replace fzf.vim or ctrlp.vim) use { @@ -28,7 +77,23 @@ return require('packer').startup(function() requires = { {'nvim-lua/plenary.nvim'}, {'kyazdani42/nvim-web-devicons', opt = true}, - } + }, + config = function() + local actions = require('telescope.actions') + require('telescope').setup { + defaults = { + mappings = { + i = { + [''] = actions.move_selection_next, + [''] = actions.move_selection_previous, + [''] = actions.close, + ['kj'] = actions.close, + } + }, + } + } + end + } -- todos,fix,etc.. highlight and list use { -- cgit From 871f5a843847e5a3103646ecdfb300a0250e486f Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Wed, 1 Dec 2021 18:06:28 +0100 Subject: Added rust lsp to neovim --- config/nvim/lua/plugins.lua | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) (limited to 'config/nvim/lua/plugins.lua') diff --git a/config/nvim/lua/plugins.lua b/config/nvim/lua/plugins.lua index 7356e43..4cd9db0 100644 --- a/config/nvim/lua/plugins.lua +++ b/config/nvim/lua/plugins.lua @@ -7,18 +7,40 @@ return require('packer').startup(function() use 'FooSoft/vim-argwrap' -- Put arguments on multiple lines use 'tpope/vim-eunuch' -- basic commands on current file (Rename/Remove) use 'romainl/vim-cool' -- only highlight search matches when searching - use 'neovim/nvim-lspconfig' -- nvim lsp configuration + -- nvim lsp configuration + use { + 'neovim/nvim-lspconfig', + config = function() + end + } + + -- rust lsp (needs rust-analyser) + use { + 'simrat39/rust-tools.nvim', + requires = {'neovim/nvim-lspconfig'}, + ft = {'rust'}, + config = function() + require('rust-tools').setup { + tools = { + inlay_hints = { + -- only_current_line = true, + }, + }, + } + end + } + + -- comment text objects use { 'numToStr/Comment.nvim', config = function() require('Comment').setup() end } - -- color scheme use { - 'ellisonleao/gruvbox.nvim', + 'ellisonleao/gruvbox.nvim', requires = {'rktjmp/lush.nvim'}, config = function() vim.opt.termguicolors = true @@ -105,4 +127,7 @@ return require('packer').startup(function() } end } + + use { 'nvim-treesitter/playground', opt = true, cmd = { 'TSPlaygroundToggle' } } + use { '~/git/argwrap.nvim', opt = true } end) -- cgit From 76d9b52f8eef8bc389ae47a1a47ff5f2f1f8375f Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Wed, 1 Dec 2021 18:15:53 +0100 Subject: Added C lsp for neovim --- config/nvim/lua/plugins.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'config/nvim/lua/plugins.lua') diff --git a/config/nvim/lua/plugins.lua b/config/nvim/lua/plugins.lua index 4cd9db0..652c1c6 100644 --- a/config/nvim/lua/plugins.lua +++ b/config/nvim/lua/plugins.lua @@ -12,6 +12,7 @@ return require('packer').startup(function() use { 'neovim/nvim-lspconfig', config = function() + require('lspconfig').clangd.setup {} end } -- cgit From 8ddbd88a633894f7cb411e6c16bac232ce30b179 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Wed, 1 Dec 2021 21:10:16 +0100 Subject: Added python lsp for neovim (with flake8 integration) --- config/nvim/lua/plugins.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'config/nvim/lua/plugins.lua') diff --git a/config/nvim/lua/plugins.lua b/config/nvim/lua/plugins.lua index 652c1c6..6b57eee 100644 --- a/config/nvim/lua/plugins.lua +++ b/config/nvim/lua/plugins.lua @@ -11,9 +11,14 @@ return require('packer').startup(function() -- nvim lsp configuration use { 'neovim/nvim-lspconfig', + ft = {'rust', 'python', 'c', 'cpp'}, config = function() - require('lspconfig').clangd.setup {} - end + local lspconfig = require('lspconfig') + lspconfig.clangd.setup {} + -- need python-lsp-server and pyls-flake8 + lspconfig.pylsp.setup {} + end, + run = 'pip3 install python-lsp-server pyls-flake8', } -- rust lsp (needs rust-analyser) -- cgit From 162f1689c620c79d822f9604db398f5c9ff0ec91 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Thu, 2 Dec 2021 20:32:46 +0100 Subject: Disabling lsp diagnostics sign in gutter neovim --- config/nvim/lua/plugins.lua | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'config/nvim/lua/plugins.lua') diff --git a/config/nvim/lua/plugins.lua b/config/nvim/lua/plugins.lua index 6b57eee..7124738 100644 --- a/config/nvim/lua/plugins.lua +++ b/config/nvim/lua/plugins.lua @@ -11,14 +11,14 @@ return require('packer').startup(function() -- nvim lsp configuration use { 'neovim/nvim-lspconfig', - ft = {'rust', 'python', 'c', 'cpp'}, - config = function() - local lspconfig = require('lspconfig') - lspconfig.clangd.setup {} - -- need python-lsp-server and pyls-flake8 - lspconfig.pylsp.setup {} - end, - run = 'pip3 install python-lsp-server pyls-flake8', + -- ft = {'rust', 'python', 'c', 'cpp'}, + -- config = function() + -- local lspconfig = require('lspconfig') + -- lspconfig.clangd.setup {} + -- -- need python-lsp-server and pyls-flake8 + -- lspconfig.pylsp.setup {} + -- -- lspconfig.rust_analyser.setup {} + -- end, } -- rust lsp (needs rust-analyser) @@ -27,12 +27,10 @@ return require('packer').startup(function() requires = {'neovim/nvim-lspconfig'}, ft = {'rust'}, config = function() - require('rust-tools').setup { - tools = { - inlay_hints = { - -- only_current_line = true, - }, - }, + require('rust-tools').setup {} + vim.diagnostic.config { + signs = false, + update_in_insert = false, } end } -- cgit From 164162c72c529c3bc4219a59fff21daa3c6841ea Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sun, 5 Dec 2021 16:46:49 +0100 Subject: Added distant.nvim and magma nvim plugins --- config/nvim/lua/plugins.lua | 47 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 8 deletions(-) (limited to 'config/nvim/lua/plugins.lua') diff --git a/config/nvim/lua/plugins.lua b/config/nvim/lua/plugins.lua index 7124738..3a365e3 100644 --- a/config/nvim/lua/plugins.lua +++ b/config/nvim/lua/plugins.lua @@ -11,14 +11,14 @@ return require('packer').startup(function() -- nvim lsp configuration use { 'neovim/nvim-lspconfig', - -- ft = {'rust', 'python', 'c', 'cpp'}, - -- config = function() - -- local lspconfig = require('lspconfig') - -- lspconfig.clangd.setup {} - -- -- need python-lsp-server and pyls-flake8 - -- lspconfig.pylsp.setup {} - -- -- lspconfig.rust_analyser.setup {} - -- end, + ft = {'rust', 'python', 'c', 'cpp'}, + config = function() + local lspconfig = require('lspconfig') + lspconfig.clangd.setup {} + -- need python-lsp-server and pyls-flake8 + lspconfig.pylsp.setup {} + -- lspconfig.rust_analyser.setup {} + end, } -- rust lsp (needs rust-analyser) @@ -118,6 +118,10 @@ return require('packer').startup(function() }, } } + local map = vim.api.nvim_set_keymap + map('n', '', 'Telescope git_files', {}) + map('n', 'H', 'Telescope help_tags', {}) + map('n', ';', 'Telescope commands', {}) end } @@ -132,6 +136,33 @@ return require('packer').startup(function() end } + -- remote files and lsp + use { + 'chipsenkbeil/distant.nvim', + config = function() + require('distant').setup { + ['*'] = require('distant.settings').chip_default() + } + end, + run = ':DistantInstall' + } + + -- jupyter kernel in nvim (with images, needs ueberzug) + use { + 'dccsillag/magma-nvim', + -- ft = { 'python' }, -- doesn't work + run = ':UpdateRemotePlugins', + config = function() + local map = vim.api.nvim_set_keymap + map('n', 'm', "nvim_exec('MagmaEvaluateOperator', v:true)", { expr = true}) + map('n', 'mm', ':MagmaEvaluateLine', {}) + map('x', 'm', ':MagmaEvaluateVisual', {}) + map('n', 'mc', ':MagmaReevaluateCell', {}) + map('n', 'md', ':MagmaDelete', {}) + map('n', 'mo', ':MagmaShowOutput', {}) + end + } + use { 'nvim-treesitter/playground', opt = true, cmd = { 'TSPlaygroundToggle' } } use { '~/git/argwrap.nvim', opt = true } end) -- cgit From 2dc81b49c99d14ea7c604dc73f5c35e134588518 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sun, 5 Dec 2021 17:26:20 +0100 Subject: Added lsp key bindings --- config/nvim/lua/plugins.lua | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) (limited to 'config/nvim/lua/plugins.lua') diff --git a/config/nvim/lua/plugins.lua b/config/nvim/lua/plugins.lua index 3a365e3..8786fe0 100644 --- a/config/nvim/lua/plugins.lua +++ b/config/nvim/lua/plugins.lua @@ -13,10 +13,25 @@ return require('packer').startup(function() 'neovim/nvim-lspconfig', ft = {'rust', 'python', 'c', 'cpp'}, config = function() + local on_attach = function(client, bufnr) + local opts = { noremap = true, silent = true } + local map = function(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end + map('n', '[', 'lua vim.lsp.buf.declaration()', opts) + map('n', ']', 'lua vim.lsp.buf.definition()', opts) + map('n', 'K', 'lua vim.lsp.buf.hover()', opts) + map('n', '[d', 'lua vim.diagnostic.goto_prev()', opts) + map('n', ']d', 'lua vim.diagnostic.goto_next()', opts) + map('n', 'q', 'Telescope lsp_workspace_diagnostics', opts) + map('n', 'rn', 'lua vim.lsp.buf.rename()', opts) + end local lspconfig = require('lspconfig') - lspconfig.clangd.setup {} + lspconfig.clangd.setup { on_attach = on_attach } -- need python-lsp-server and pyls-flake8 - lspconfig.pylsp.setup {} + lspconfig.pylsp.setup { on_attach = on_attach } + vim.diagnostic.config { + signs = false, + update_in_insert = false, + } -- lspconfig.rust_analyser.setup {} end, } @@ -155,11 +170,11 @@ return require('packer').startup(function() config = function() local map = vim.api.nvim_set_keymap map('n', 'm', "nvim_exec('MagmaEvaluateOperator', v:true)", { expr = true}) - map('n', 'mm', ':MagmaEvaluateLine', {}) - map('x', 'm', ':MagmaEvaluateVisual', {}) - map('n', 'mc', ':MagmaReevaluateCell', {}) - map('n', 'md', ':MagmaDelete', {}) - map('n', 'mo', ':MagmaShowOutput', {}) + map('n', 'mm', 'MagmaEvaluateLine', {}) + map('x', 'm', 'MagmaEvaluateVisual', {}) + map('n', 'mc', 'MagmaReevaluateCell', {}) + map('n', 'md', 'MagmaDelete', {}) + map('n', 'mo', 'MagmaShowOutput', {}) end } -- cgit From 6bb3fa958f775c9ff5769e2cb00ccaabe664fd99 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sun, 5 Dec 2021 19:08:59 +0100 Subject: Added rust_analyzer lsp --- config/nvim/lua/plugins.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'config/nvim/lua/plugins.lua') diff --git a/config/nvim/lua/plugins.lua b/config/nvim/lua/plugins.lua index 8786fe0..dca67fb 100644 --- a/config/nvim/lua/plugins.lua +++ b/config/nvim/lua/plugins.lua @@ -28,11 +28,12 @@ return require('packer').startup(function() lspconfig.clangd.setup { on_attach = on_attach } -- need python-lsp-server and pyls-flake8 lspconfig.pylsp.setup { on_attach = on_attach } + -- rust_analyzer + lspconfig.rust_analyzer.setup { on_attach = on_attach } vim.diagnostic.config { signs = false, update_in_insert = false, } - -- lspconfig.rust_analyser.setup {} end, } -- cgit From 4adc57a365aa52ff5d4509fb6b09fc54878d9342 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sun, 5 Dec 2021 19:24:37 +0100 Subject: Added lua lsp --- config/nvim/lua/plugins.lua | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'config/nvim/lua/plugins.lua') diff --git a/config/nvim/lua/plugins.lua b/config/nvim/lua/plugins.lua index dca67fb..72ef03d 100644 --- a/config/nvim/lua/plugins.lua +++ b/config/nvim/lua/plugins.lua @@ -11,7 +11,7 @@ return require('packer').startup(function() -- nvim lsp configuration use { 'neovim/nvim-lspconfig', - ft = {'rust', 'python', 'c', 'cpp'}, + ft = {'rust', 'python', 'c', 'cpp', 'lua'}, config = function() local on_attach = function(client, bufnr) local opts = { noremap = true, silent = true } @@ -30,6 +30,31 @@ return require('packer').startup(function() lspconfig.pylsp.setup { on_attach = on_attach } -- rust_analyzer lspconfig.rust_analyzer.setup { on_attach = on_attach } + -- package lua-language-server on ArchLinux + lspconfig.sumneko_lua.setup { + on_attach = on_attach , + settings = { + Lua = { + runtime = { + -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) + version = 'LuaJIT', + -- Setup your lua path + path = vim.split(package.path, ';'), + }, + diagnostics = { + -- Get the language server to recognize the `vim` global + globals = {'vim'}, + }, + workspace = { + -- Make the server aware of Neovim runtime files + library = { + [vim.fn.expand('$VIMRUNTIME/lua')] = true, + [vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true, + }, + }, + } + }, + } vim.diagnostic.config { signs = false, update_in_insert = false, -- cgit