diff options
| author | Charles Cabergs <charles.cabergs@colruytgroup.com> | 2022-02-22 14:07:23 +0100 |
|---|---|---|
| committer | Charles Cabergs <charles.cabergs@colruytgroup.com> | 2022-02-22 14:07:23 +0100 |
| commit | 8df9c6e8a99aa1a82a4adfdf20194c9ab53f6beb (patch) | |
| tree | 9b96ba6a2046468a83d892ffc365fca278011a95 /config | |
| parent | c72c63331c002e0592127638a59cd35bd4b7c34f (diff) | |
| download | dotfiles-8df9c6e8a99aa1a82a4adfdf20194c9ab53f6beb.tar.gz dotfiles-8df9c6e8a99aa1a82a4adfdf20194c9ab53f6beb.tar.bz2 dotfiles-8df9c6e8a99aa1a82a4adfdf20194c9ab53f6beb.zip | |
Disabling neovim lsp, Added neovim tags support
Diffstat (limited to 'config')
| -rw-r--r-- | config/nvim/lua/plugins.lua | 178 | ||||
| -rw-r--r-- | config/zsh/aliases.zsh | 8 |
2 files changed, 102 insertions, 84 deletions
diff --git a/config/nvim/lua/plugins.lua b/config/nvim/lua/plugins.lua index 71498e9..e820099 100644 --- a/config/nvim/lua/plugins.lua +++ b/config/nvim/lua/plugins.lua @@ -8,92 +8,109 @@ return require('packer').startup(function() use 'tpope/vim-eunuch' -- basic commands on current file (Rename/Remove) use 'romainl/vim-cool' -- only highlight search matches when searching - -- nvim lsp configuration + -- tags managment use { - 'neovim/nvim-lspconfig', - ft = {'rust', 'python', 'c', 'cpp', 'lua'}, + 'ludovicchabant/vim-gutentags', config = function() - local on_attach = function(_, bufnr) - local opts = { noremap = true, silent = true } - local map = function(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end - map('n', '<leader>[', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts) - map('n', '<leader>]', '<cmd>lua vim.lsp.buf.definition()<CR>', opts) - map('n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts) - map('n', 'gk', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts) - map('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts) - map('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<CR>', opts) - map('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<CR>', opts) - map('n', '<leader>q', '<cmd>Telescope diagnostics<CR>', opts) - map('n', '<leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts) - end - local lspconfig = require('lspconfig') - lspconfig.clangd.setup { on_attach = on_attach } - lspconfig.rust_analyzer.setup { on_attach = on_attach } - -- need python-lsp-server and pyls-flake8 - lspconfig.pylsp.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, - } - end, - } - - -- rust lsp (needs rust-analyser) - use { - 'simrat39/rust-tools.nvim', - requires = {'neovim/nvim-lspconfig'}, - ft = {'rust'}, - config = function() - local on_attach = function(_, bufnr) - local opts = { noremap = true, silent = true } - local map = function(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end - map('n', '<leader>[', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts) - map('n', '<leader>]', '<cmd>lua vim.lsp.buf.definition()<CR>', opts) - map('n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts) - map('n', 'gk', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts) - map('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts) - map('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<CR>', opts) - map('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<CR>', opts) - map('n', '<leader>q', '<cmd>Telescope diagnostics<CR>', opts) - map('n', '<leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts) - end - require('rust-tools').setup { - server = { - on_attach = on_attach, - } - } - vim.diagnostic.config { - signs = false, - update_in_insert = false, + vim.g.gutentags_ctags_exclude = { + 'doc/*', + 'docs/*', + 'Makefile', + '.mypy_cache', + '.pytest_cache', + '.tox', + 'build/*', + 'dist/*' } end } + -- nvim lsp configuration + -- use { + -- 'neovim/nvim-lspconfig', + -- ft = {'rust', 'python', 'c', 'cpp', 'lua'}, + -- config = function() + -- local on_attach = function(_, bufnr) + -- local opts = { noremap = true, silent = true } + -- local map = function(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end + -- map('n', '<leader>[', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts) + -- map('n', '<leader>]', '<cmd>lua vim.lsp.buf.definition()<CR>', opts) + -- map('n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts) + -- map('n', 'gk', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts) + -- map('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts) + -- map('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<CR>', opts) + -- map('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<CR>', opts) + -- map('n', '<leader>q', '<cmd>Telescope diagnostics<CR>', opts) + -- map('n', '<leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts) + -- end + -- local lspconfig = require('lspconfig') + -- lspconfig.clangd.setup { on_attach = on_attach } + -- lspconfig.rust_analyzer.setup { on_attach = on_attach } + -- -- need python-lsp-server and pyls-flake8 + -- lspconfig.pylsp.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, + -- } + -- end, + -- } + -- + -- -- rust lsp (needs rust-analyser) + -- use { + -- 'simrat39/rust-tools.nvim', + -- requires = {'neovim/nvim-lspconfig'}, + -- ft = {'rust'}, + -- config = function() + -- local on_attach = function(_, bufnr) + -- local opts = { noremap = true, silent = true } + -- local map = function(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end + -- map('n', '<leader>[', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts) + -- map('n', '<leader>]', '<cmd>lua vim.lsp.buf.definition()<CR>', opts) + -- map('n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts) + -- map('n', 'gk', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts) + -- map('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts) + -- map('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<CR>', opts) + -- map('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<CR>', opts) + -- map('n', '<leader>q', '<cmd>Telescope diagnostics<CR>', opts) + -- map('n', '<leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts) + -- end + -- require('rust-tools').setup { + -- server = { + -- on_attach = on_attach, + -- } + -- } + -- vim.diagnostic.config { + -- signs = false, + -- update_in_insert = false, + -- } + -- end + -- } + -- comment text objects use { 'numToStr/Comment.nvim', @@ -181,6 +198,7 @@ return require('packer').startup(function() 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>', {}) + map('n', '<leader>p', '<cmd>Telescope tags<cr>', {}) end } diff --git a/config/zsh/aliases.zsh b/config/zsh/aliases.zsh index 7832558..3a5d0af 100644 --- a/config/zsh/aliases.zsh +++ b/config/zsh/aliases.zsh @@ -83,6 +83,10 @@ gpaf() { git remote | xargs -I{} git push -f {} "$branch" } +alias ytdl='youtube-dl --output "%(title)s.%(ext)s"' +alias ytdlp='youtube-dl --audio-format mp3 -i --output "%(playlist_index)s-%(title)s.%(ext)s"' +alias ytdla='youtube-dl --audio-format mp3 -i -x -f bestaudio/best --output "%(playlist_index)s-%(title)s.%(ext)s"' + # Linux specific aliases [ ! "$(uname)" = 'Linux' ] && return @@ -116,10 +120,6 @@ alias cagor='RUSTFLAGS="$RUSTFLAGS -A dead_code" cargo run' # wifi wificonnect() { nmcli device wifi connect "$1" password "$2" ; } -alias ytdl='youtube-dl --output "%(title)s.%(ext)s"' -alias ytdlp='youtube-dl --audio-format mp3 -i --output "%(playlist_index)s-%(title)s.%(ext)s"' -alias ytdla='youtube-dl --audio-format mp3 -i -x -f bestaudio/best --output "%(playlist_index)s-%(title)s.%(ext)s"' - alias qmvdest='qmv --format=do' alias xclip='xclip -selection clipboard' |
