diff options
| author | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2021-11-25 00:05:34 +0100 |
|---|---|---|
| committer | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2021-11-25 00:05:59 +0100 |
| commit | 412f51cd7ad4ce610ecaf13210b52709fb3e0232 (patch) | |
| tree | bf6475830cc0df42b671bf7ce9a1b33fe70f0e37 /plugin | |
| parent | 31efe743072b868d4bb86ed709b85253db0b1f60 (diff) | |
| download | nvim-conf-412f51cd7ad4ce610ecaf13210b52709fb3e0232.tar.gz nvim-conf-412f51cd7ad4ce610ecaf13210b52709fb3e0232.zip | |
Move config to lua. Add laravel snippets
Diffstat (limited to 'plugin')
| -rw-r--r-- | plugin/alpha.vim | 13 | ||||
| -rw-r--r-- | plugin/keymap.vim | 1 | ||||
| -rw-r--r-- | plugin/lsp.vim | 43 | ||||
| -rw-r--r-- | plugin/plugins.vim | 1 | ||||
| -rw-r--r-- | plugin/sets.vim | 2 | ||||
| -rw-r--r-- | plugin/status.vim | 1 | ||||
| -rw-r--r-- | plugin/treesitter.vim | 54 |
7 files changed, 16 insertions, 99 deletions
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 <leader><leader>x :call alpha#save_and_exec()<CR> 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 <leader>vd :lua vim.lsp.buf.definition()<CR> -nnoremap <leader>vsh :lua vim.lsp.buf.signature_help()<CR> -nnoremap <leader>vh :lua vim.lsp.buf.hover()<CR> - -" to test -nnoremap <leader>vi :lua vim.lsp.buf.implementation()<CR> -nnoremap <leader>vf :lua vim.lsp.buf.formatting()<CR> -nnoremap <leader>vrn :lua vim.lsp.buf.rename()<CR> -nnoremap <leader>vca :lua vim.lsp.buf.code_action()<CR> -nnoremap <leader>vsd :lua vim.lsp.util.show_line_diagnostics(); vim.lsp.util.show_line_diagnostics()<CR> -nnoremap <leader>vn :lua vim.lsp.diagnostic.goto_next()<CR> - -nnoremap <leader>vo :LspRestart<CR> - - -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()<cr>', {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 = '<cr>', - show_help = '?', - }, - } -} - -EOF |