From 8df9c6e8a99aa1a82a4adfdf20194c9ab53f6beb Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Tue, 22 Feb 2022 14:07:23 +0100 Subject: Disabling neovim lsp, Added neovim tags support --- config/nvim/lua/plugins.lua | 178 ++++++++++++++++++++++++-------------------- config/zsh/aliases.zsh | 8 +- 2 files changed, 102 insertions(+), 84 deletions(-) (limited to 'config') 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', '[', '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', 'gk', 'lua vim.lsp.buf.signature_help()', opts) - map('n', 'gd', 'lua vim.lsp.buf.definition()', opts) - map('n', '[d', 'lua vim.diagnostic.goto_prev()', opts) - map('n', ']d', 'lua vim.diagnostic.goto_next()', opts) - map('n', 'q', 'Telescope diagnostics', opts) - map('n', 'rn', 'lua vim.lsp.buf.rename()', 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', '[', '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', 'gk', 'lua vim.lsp.buf.signature_help()', opts) - map('n', 'gd', 'lua vim.lsp.buf.definition()', opts) - map('n', '[d', 'lua vim.diagnostic.goto_prev()', opts) - map('n', ']d', 'lua vim.diagnostic.goto_next()', opts) - map('n', 'q', 'Telescope diagnostics', opts) - map('n', 'rn', 'lua vim.lsp.buf.rename()', 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', '[', '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', 'gk', 'lua vim.lsp.buf.signature_help()', opts) + -- map('n', 'gd', 'lua vim.lsp.buf.definition()', opts) + -- map('n', '[d', 'lua vim.diagnostic.goto_prev()', opts) + -- map('n', ']d', 'lua vim.diagnostic.goto_next()', opts) + -- map('n', 'q', 'Telescope diagnostics', opts) + -- map('n', 'rn', 'lua vim.lsp.buf.rename()', 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', '[', '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', 'gk', 'lua vim.lsp.buf.signature_help()', opts) + -- map('n', 'gd', 'lua vim.lsp.buf.definition()', opts) + -- map('n', '[d', 'lua vim.diagnostic.goto_prev()', opts) + -- map('n', ']d', 'lua vim.diagnostic.goto_next()', opts) + -- map('n', 'q', 'Telescope diagnostics', opts) + -- map('n', 'rn', 'lua vim.lsp.buf.rename()', 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', '', 'Telescope git_files', {}) map('n', 'H', 'Telescope help_tags', {}) map('n', ';', 'Telescope commands', {}) + map('n', 'p', 'Telescope tags', {}) 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' -- cgit