From 412f51cd7ad4ce610ecaf13210b52709fb3e0232 Mon Sep 17 00:00:00 2001 From: Ariel D'Alessandro Date: Thu, 25 Nov 2021 00:05:34 +0100 Subject: Move config to lua. Add laravel snippets --- plugin/alpha.vim | 13 +++++++++++++ plugin/keymap.vim | 1 + plugin/lsp.vim | 43 ---------------------------------------- plugin/plugins.vim | 1 - plugin/sets.vim | 2 ++ plugin/status.vim | 1 - plugin/treesitter.vim | 54 --------------------------------------------------- 7 files changed, 16 insertions(+), 99 deletions(-) create mode 100644 plugin/alpha.vim create mode 100644 plugin/keymap.vim delete mode 100644 plugin/status.vim delete mode 100644 plugin/treesitter.vim (limited to 'plugin') diff --git a/plugin/alpha.vim b/plugin/alpha.vim new file mode 100644 index 0000000..9a8969c --- /dev/null +++ b/plugin/alpha.vim @@ -0,0 +1,13 @@ +if !exists('*alpha#save_and_exec') + function! alpha#save_and_exec() abort + if &filetype == 'vim' + :silent! write + :source % + elseif &filetype == 'lua' + :silent! write + :luafi % + endif + + return + endfunction +endif diff --git a/plugin/keymap.vim b/plugin/keymap.vim new file mode 100644 index 0000000..2e7f810 --- /dev/null +++ b/plugin/keymap.vim @@ -0,0 +1 @@ +nnoremap x :call alpha#save_and_exec() diff --git a/plugin/lsp.vim b/plugin/lsp.vim index 82d9a8f..e69de29 100644 --- a/plugin/lsp.vim +++ b/plugin/lsp.vim @@ -1,43 +0,0 @@ -nnoremap vd :lua vim.lsp.buf.definition() -nnoremap vsh :lua vim.lsp.buf.signature_help() -nnoremap vh :lua vim.lsp.buf.hover() - -" to test -nnoremap vi :lua vim.lsp.buf.implementation() -nnoremap vf :lua vim.lsp.buf.formatting() -nnoremap vrn :lua vim.lsp.buf.rename() -nnoremap vca :lua vim.lsp.buf.code_action() -nnoremap vsd :lua vim.lsp.util.show_line_diagnostics(); vim.lsp.util.show_line_diagnostics() -nnoremap vn :lua vim.lsp.diagnostic.goto_next() - -nnoremap vo :LspRestart - - -au Filetype php setl omnifunc=v:lua.vim.lsp.omnifunc -autocmd FileType go setlocal omnifunc=v:lua.vim.lsp.omnifunc - -let g:completion_matching_strategy_list = ['exact', 'substring', 'fuzzy'] - -lua << EOF - -local function on_attach() - vim.api.nvim_set_keymap('n', 'K', ':lua vim.lsp.buf.hover()', {noremap = true}) - - require "lsp_signature".on_attach() -end - -local lsp_installer = require("nvim-lsp-installer") - -lsp_installer.on_server_ready(function(server) - local opts = {} - - -- (optional) Customize the options passed to the server - if server.name == "emmet_ls" then - opts.filetypes = {"html", "css", "blade"} - end - opts.on_attach = on_attach - - -- This setup() function is exactly the same as lspconfig's setup function (:help lspconfig-quickstart) - server:setup(opts) - vim.cmd [[ do User LspAttachBuffers ]] -end) diff --git a/plugin/plugins.vim b/plugin/plugins.vim index f5df1c5..e69de29 100644 --- a/plugin/plugins.vim +++ b/plugin/plugins.vim @@ -1 +0,0 @@ -lua require('plugins') diff --git a/plugin/sets.vim b/plugin/sets.vim index 9a08a5c..d2e7599 100644 --- a/plugin/sets.vim +++ b/plugin/sets.vim @@ -12,6 +12,8 @@ set undofile set undodir=~/.config/nvim/undodir set nohlsearch set incsearch +set ignorecase +set smartcase set termguicolors set scrolloff=8 set sidescrolloff=8 diff --git a/plugin/status.vim b/plugin/status.vim deleted file mode 100644 index 9936f3e..0000000 --- a/plugin/status.vim +++ /dev/null @@ -1 +0,0 @@ -lua require("alpha.status-line") diff --git a/plugin/treesitter.vim b/plugin/treesitter.vim deleted file mode 100644 index b6bbd03..0000000 --- a/plugin/treesitter.vim +++ /dev/null @@ -1,54 +0,0 @@ -lua << EOF - -require "nvim-treesitter.configs".setup { - highlight = { - enable = true, - additional_vim_regex_highlighting = false, - }, - indent = { - enable = true, - }, - refactor = { - highlight_definitions = { enable = true }, - smart_rename = { - enable = true, - keymaps = { - smart_rename = "grr", - }, - }, - }, - textobjects = { - select = { - enable = true, - lookahead = true, - keymaps = { - ["af"] = "@function.outer", - ["if"] = "@function.inner", - ["ac"] = "@conditional.outer", - ["ic"] = "@conditional.inner", - ["al"] = "@loop.outer", - ["il"] = "@loop.inner", - } - } - }, - playground = { - enable = true, - disable = {}, - updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code - persist_queries = false, -- Whether the query persists across vim sessions - keybindings = { - toggle_query_editor = 'o', - toggle_hl_groups = 'i', - toggle_injected_languages = 't', - toggle_anonymous_nodes = 'a', - toggle_language_display = 'I', - focus_language = 'f', - unfocus_language = 'F', - update = 'R', - goto_node = '', - show_help = '?', - }, - } -} - -EOF -- cgit v1.2.3