aboutsummaryrefslogtreecommitdiff
path: root/config/nvim/lua
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2021-12-05 16:46:49 +0100
committerCharles Cabergs <me@cacharle.xyz>2021-12-05 16:46:49 +0100
commit164162c72c529c3bc4219a59fff21daa3c6841ea (patch)
tree40f707af31cd1c554871fa2fca048b64bc30c2a4 /config/nvim/lua
parent7495daf2b5073739ec2f3af027542a4a28d47c60 (diff)
downloaddotfiles-164162c72c529c3bc4219a59fff21daa3c6841ea.tar.gz
dotfiles-164162c72c529c3bc4219a59fff21daa3c6841ea.tar.bz2
dotfiles-164162c72c529c3bc4219a59fff21daa3c6841ea.zip
Added distant.nvim and magma nvim plugins
Diffstat (limited to 'config/nvim/lua')
-rw-r--r--config/nvim/lua/mappings.lua5
-rw-r--r--config/nvim/lua/plugins.lua47
2 files changed, 39 insertions, 13 deletions
diff --git a/config/nvim/lua/mappings.lua b/config/nvim/lua/mappings.lua
index a99a478..1e051d7 100644
--- a/config/nvim/lua/mappings.lua
+++ b/config/nvim/lua/mappings.lua
@@ -47,7 +47,6 @@ vim.cmd [[ autocmd FileType python nmap <leader>bd :g/^\s*breakpoint()$/d<cr> ]]
vim.cmd [[ autocmd FileType python nmap <leader>ba mqobreakpoint()<esc>`q ]]
-- pluggins
-
map('x', 'ga', '<cmd>EasyAlign<cr>', {})
map('n', 'ga', '<cmd>EasyAlign<cr>', {})
@@ -55,7 +54,3 @@ map('n', '<leader>l', '<cmd>SidewaysRight<cr>', {})
map('n', '<leader>h', '<cmd>SidewaysLeft<cr>', {})
map('n', '<leader>w', '<cmd>ArgWrap<cr>', {})
-
-map('n', '<C-p>', '<cmd>Telescope git_files<cr>', {})
-map('n', '<leader>H', '<cmd>Telescope help_tags<cr>', {})
-map('n', '<leader>;', '<cmd>Telescope commands<cr>', {})
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', '<C-p>', '<cmd>Telescope git_files<cr>', {})
+ map('n', '<leader>H', '<cmd>Telescope help_tags<cr>', {})
+ map('n', '<leader>;', '<cmd>Telescope commands<cr>', {})
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', '<leader>m', "nvim_exec('MagmaEvaluateOperator', v:true)", { expr = true})
+ map('n', '<leader>mm', ':MagmaEvaluateLine<CR>', {})
+ map('x', '<leader>m', ':<C-u>MagmaEvaluateVisual<CR>', {})
+ map('n', '<leader>mc', ':MagmaReevaluateCell<CR>', {})
+ map('n', '<leader>md', ':MagmaDelete<CR>', {})
+ map('n', '<leader>mo', ':MagmaShowOutput<CR>', {})
+ end
+ }
+
use { 'nvim-treesitter/playground', opt = true, cmd = { 'TSPlaygroundToggle' } }
use { '~/git/argwrap.nvim', opt = true }
end)