diff options
| author | Ariel D'ALessandro <dalessandro.ariel@gmail.com> | 2021-08-15 20:19:26 +0200 |
|---|---|---|
| committer | Ariel D'ALessandro <dalessandro.ariel@gmail.com> | 2021-08-15 20:19:26 +0200 |
| commit | fd01b6c1b3081d8acbd8d2408134e45ef25aa163 (patch) | |
| tree | 83705dc38a8a3d6ab75e664ec68c9b987e95a8e3 | |
| parent | 7c8ba7a40a3209fc1cf483e82f62560b4dff1a06 (diff) | |
| download | nvim-conf-fd01b6c1b3081d8acbd8d2408134e45ef25aa163.tar.gz nvim-conf-fd01b6c1b3081d8acbd8d2408134e45ef25aa163.zip | |
move to user packer, switch keybinding for new branch
| -rw-r--r-- | init.vim | 79 | ||||
| -rw-r--r-- | lua/alpha/telescope.lua | 8 | ||||
| -rw-r--r-- | lua/plugins.lua | 79 | ||||
| -rw-r--r-- | plugin/packer_compiled.lua | 175 | ||||
| -rw-r--r-- | plugin/telescope.vim | 2 | ||||
| -rw-r--r-- | plugin/treesitter.vim | 28 |
6 files changed, 283 insertions, 88 deletions
@@ -1,84 +1,6 @@ " Allows to have a .nvimrc per project folder set exrc -" Install Vimplug if not installed -if ! filereadable(expand('~/.config/nvim/autoload/plug.vim')) - echo "Downloading junegunn/vim-plug to manage plugins..." - silent !mkdir -p ~/.config/nvim/autoload/ - silent !curl "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > ~/.config/nvim/autoload/plug.vim - autocmd VimEnter * PlugInstall -endif - -" Set plugin folder -call plug#begin('~/.config/nvim/plugged') - -" LSP -Plug 'neovim/nvim-lspconfig' -" Plug 'nvim-lua/completion-nvim' -Plug 'hrsh7th/nvim-compe' -Plug 'anott03/nvim-lspinstall' - -" General use plugins -Plug 'Raimondi/delimitMate' -Plug 'tpope/vim-surround' -Plug 'tpope/vim-fugitive' -Plug 'tpope/vim-repeat' -Plug 'tpope/vim-obsession' -Plug 'tpope/vim-vinegar' -Plug 'tpope/vim-eunuch' -Plug 'tpope/vim-commentary' -Plug 'tpope/vim-tbone' -Plug 'tpope/vim-dadbod' -Plug 'airblade/vim-gitgutter' -Plug 'hashivim/vim-terraform' -Plug 'mattn/emmet-vim' - -Plug 'nicwest/vim-http' - -Plug 'vimwiki/vimwiki' - -" Laravel specific -Plug 'tpope/vim-dispatch' -Plug 'tpope/vim-projectionist' -Plug 'noahfrederick/vim-composer' -Plug 'noahfrederick/vim-laravel' -Plug 'jwalton512/vim-blade' - -" Treesitter -Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} -Plug 'nvim-treesitter/playground' - -" Golang -Plug 'fatih/vim-go' - -" Testing -Plug 'vim-test/vim-test' - -" Debug -Plug 'mfussenegger/nvim-dap' -Plug 'puremourning/vimspector' -Plug 'szw/vim-maximizer' - -Plug 'gruvbox-community/gruvbox' - -Plug 'fladson/vim-kitty' - -" Telescope -Plug 'nvim-lua/popup.nvim' -Plug 'nvim-lua/plenary.nvim' -Plug 'nvim-telescope/telescope.nvim' -Plug 'nvim-telescope/telescope-fzy-native.nvim' - -Plug 'kyazdani42/nvim-web-devicons' - -Plug 'hoob3rt/lualine.nvim' - -Plug 'sbdchd/neoformat' - -Plug 'mbbill/undotree' - -call plug#end() - syntax enable let mapleader = ' ' @@ -86,7 +8,6 @@ let mapleader = ' ' inoremap <C-c> <esc> nnoremap <Leader><CR> :so ~/.config/nvim/init.vim<CR> -nnoremap <leader>uu :UndotreeToggle<CR> let g:vimwiki_list = [{'path': '~/vimwiki/', \ 'syntax': 'markdown', 'ext': '.md'}] diff --git a/lua/alpha/telescope.lua b/lua/alpha/telescope.lua index 681c55f..6bb4150 100644 --- a/lua/alpha/telescope.lua +++ b/lua/alpha/telescope.lua @@ -40,4 +40,12 @@ M.buffers = function() require("telescope.builtin").buffers() end +M.branches = function() + require'telescope.builtin'.git_branches({ attach_mappings = function(_, map) + map('i', '<c-j>', actions.git_create_branch) + map('n', '<c-j>', actions.git_create_branch) + return true + end}) +end + return M diff --git a/lua/plugins.lua b/lua/plugins.lua index ebe891d..548b69b 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -2,10 +2,83 @@ vim.cmd [[packadd packer.nvim]] return require('packer').startup(function() use { - "ThePrimeagen/refactoring.nvim", + 'ThePrimeagen/refactoring.nvim', requires = { - {"nvim-lua/plenary.nvim"}, - {"nvim-treesitter/nvim-treesitter"} + {'nvim-lua/plenary.nvim'}, + {'nvim-treesitter/nvim-treesitter'} } } + + + use { 'nvim-treesitter/nvim-treesitter', run = ':TSUpdate' } + use { 'nvim-treesitter/playground' } + + use { 'tpope/vim-dispatch', opt = true, cmd = {'Dispatch', 'Make', 'Focus', 'Start'}} + + use 'sbdchd/neoformat' + + use { + 'neovim/nvim-lspconfig', + requires = { + { 'hrsh7th/nvim-compe' }, + { 'anott03/nvim-lspinstall' } + } + } + + use { + 'nvim-telescope/telescope.nvim', + requires = { + { 'nvim-lua/plenary.nvim'}, + { 'nvim-lua/popup.nvim' }, + { 'nvim-telescope/telescope-fzy-native.nvim' }, + { 'kyazdani42/nvim-web-devicons' } + } + } + + use 'hoob3rt/lualine.nvim' + + use { + 'puremourning/vimspector', + requires = { + { 'mfussenegger/nvim-dap' } + } + } + + use 'szw/vim-maximizer' + + use 'vim-test/vim-test' + + use 'fatih/vim-go' + + use { + 'noahfrederick/vim-laravel', + requires = { + { 'tpope/vim-projectionist' }, + { 'noahfrederick/vim-composer' } + } + } + + use 'jwalton512/vim-blade' + use 'fladson/vim-kitty' + + use 'gruvbox-community/gruvbox' + + use 'Raimondi/delimitMate' + use 'tpope/vim-surround' + use 'tpope/vim-fugitive' + use 'tpope/vim-repeat' + use 'tpope/vim-obsession' + use 'tpope/vim-vinegar' + use 'tpope/vim-eunuch' + use 'tpope/vim-commentary' + use 'tpope/vim-tbone' + use 'tpope/vim-dadbod' + use 'airblade/vim-gitgutter' + use 'hashivim/vim-terraform' + use 'mattn/emmet-vim' + + use { 'nicwest/vim-http', opt = true, cmd = {'Http'}} + + use { 'vimwiki/vimwiki', opt = true, cmd = {'VimwikiIndex'}} + end) diff --git a/plugin/packer_compiled.lua b/plugin/packer_compiled.lua index 937e98d..f3d87e2 100644 --- a/plugin/packer_compiled.lua +++ b/plugin/packer_compiled.lua @@ -44,8 +44,8 @@ local function save_profiles(threshold) end time([[Luarocks path setup]], true) -local package_path_str = "/home/arieldalessandro/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/home/arieldalessandro/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/home/arieldalessandro/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/home/arieldalessandro/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua" -local install_cpath_pattern = "/home/arieldalessandro/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so" +local package_path_str = "/home/alpha/.cache/nvim/packer_hererocks/2.0.5/share/lua/5.1/?.lua;/home/alpha/.cache/nvim/packer_hererocks/2.0.5/share/lua/5.1/?/init.lua;/home/alpha/.cache/nvim/packer_hererocks/2.0.5/lib/luarocks/rocks-5.1/?.lua;/home/alpha/.cache/nvim/packer_hererocks/2.0.5/lib/luarocks/rocks-5.1/?/init.lua" +local install_cpath_pattern = "/home/alpha/.cache/nvim/packer_hererocks/2.0.5/lib/lua/5.1/?.so" if not string.find(package.path, package_path_str, 1, true) then package.path = package.path .. ';' .. package_path_str end @@ -69,21 +69,186 @@ end time([[try_loadstring definition]], false) time([[Defining packer_plugins]], true) _G.packer_plugins = { + delimitMate = { + loaded = true, + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/delimitMate" + }, + ["emmet-vim"] = { + loaded = true, + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/emmet-vim" + }, + gruvbox = { + loaded = true, + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/gruvbox" + }, + ["lualine.nvim"] = { + loaded = true, + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/lualine.nvim" + }, + neoformat = { + loaded = true, + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/neoformat" + }, + ["nvim-compe"] = { + loaded = true, + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/nvim-compe" + }, + ["nvim-dap"] = { + loaded = true, + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/nvim-dap" + }, + ["nvim-lspconfig"] = { + loaded = true, + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/nvim-lspconfig" + }, + ["nvim-lspinstall"] = { + loaded = true, + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/nvim-lspinstall" + }, ["nvim-treesitter"] = { loaded = true, - path = "/home/arieldalessandro/.local/share/nvim/site/pack/packer/start/nvim-treesitter" + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/nvim-treesitter" + }, + ["nvim-web-devicons"] = { + loaded = true, + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/nvim-web-devicons" + }, + playground = { + loaded = true, + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/playground" }, ["plenary.nvim"] = { loaded = true, - path = "/home/arieldalessandro/.local/share/nvim/site/pack/packer/start/plenary.nvim" + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/plenary.nvim" + }, + ["popup.nvim"] = { + loaded = true, + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/popup.nvim" }, ["refactoring.nvim"] = { loaded = true, - path = "/home/arieldalessandro/.local/share/nvim/site/pack/packer/start/refactoring.nvim" + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/refactoring.nvim" + }, + ["telescope-fzy-native.nvim"] = { + loaded = true, + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/telescope-fzy-native.nvim" + }, + ["telescope.nvim"] = { + loaded = true, + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/telescope.nvim" + }, + ["vim-blade"] = { + loaded = true, + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/vim-blade" + }, + ["vim-commentary"] = { + loaded = true, + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/vim-commentary" + }, + ["vim-composer"] = { + loaded = true, + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/vim-composer" + }, + ["vim-dadbod"] = { + loaded = true, + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/vim-dadbod" + }, + ["vim-dispatch"] = { + commands = { "Dispatch", "Make", "Focus", "Start" }, + loaded = false, + needs_bufread = false, + path = "/home/alpha/.local/share/nvim/site/pack/packer/opt/vim-dispatch" + }, + ["vim-eunuch"] = { + loaded = true, + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/vim-eunuch" + }, + ["vim-fugitive"] = { + loaded = true, + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/vim-fugitive" + }, + ["vim-gitgutter"] = { + loaded = true, + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/vim-gitgutter" + }, + ["vim-go"] = { + loaded = true, + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/vim-go" + }, + ["vim-http"] = { + commands = { "Http" }, + loaded = false, + needs_bufread = false, + path = "/home/alpha/.local/share/nvim/site/pack/packer/opt/vim-http" + }, + ["vim-kitty"] = { + loaded = true, + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/vim-kitty" + }, + ["vim-laravel"] = { + loaded = true, + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/vim-laravel" + }, + ["vim-maximizer"] = { + loaded = true, + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/vim-maximizer" + }, + ["vim-obsession"] = { + loaded = true, + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/vim-obsession" + }, + ["vim-projectionist"] = { + loaded = true, + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/vim-projectionist" + }, + ["vim-repeat"] = { + loaded = true, + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/vim-repeat" + }, + ["vim-surround"] = { + loaded = true, + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/vim-surround" + }, + ["vim-tbone"] = { + loaded = true, + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/vim-tbone" + }, + ["vim-terraform"] = { + loaded = true, + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/vim-terraform" + }, + ["vim-test"] = { + loaded = true, + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/vim-test" + }, + ["vim-vinegar"] = { + loaded = true, + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/vim-vinegar" + }, + vimspector = { + loaded = true, + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/vimspector" + }, + vimwiki = { + commands = { "VimwikiIndex" }, + loaded = false, + needs_bufread = false, + path = "/home/alpha/.local/share/nvim/site/pack/packer/opt/vimwiki" } } time([[Defining packer_plugins]], false) + +-- Command lazy-loads +time([[Defining lazy-load commands]], true) +pcall(vim.cmd, [[command! -nargs=* -range -bang -complete=file Make lua require("packer.load")({'vim-dispatch'}, { cmd = "Make", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args> }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command! -nargs=* -range -bang -complete=file Focus lua require("packer.load")({'vim-dispatch'}, { cmd = "Focus", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args> }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command! -nargs=* -range -bang -complete=file Http lua require("packer.load")({'vim-http'}, { cmd = "Http", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args> }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command! -nargs=* -range -bang -complete=file VimwikiIndex lua require("packer.load")({'vimwiki'}, { cmd = "VimwikiIndex", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args> }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command! -nargs=* -range -bang -complete=file Dispatch lua require("packer.load")({'vim-dispatch'}, { cmd = "Dispatch", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args> }, _G.packer_plugins)]]) +pcall(vim.cmd, [[command! -nargs=* -range -bang -complete=file Start lua require("packer.load")({'vim-dispatch'}, { cmd = "Start", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args> }, _G.packer_plugins)]]) +time([[Defining lazy-load commands]], false) + if should_profile then save_profiles() end end) diff --git a/plugin/telescope.vim b/plugin/telescope.vim index e057d4c..291a339 100644 --- a/plugin/telescope.vim +++ b/plugin/telescope.vim @@ -15,7 +15,7 @@ nnoremap <leader>pe :lua require('alpha.telescope').buffers()<CR> nnoremap <leader>bb :lua require('telescope.builtin').file_browser()<CR> -nnoremap <leader>gc :lua require('telescope.builtin').git_branches()<CR> +nnoremap <leader>gc :lua require('alpha.telescope').branches()<CR> nnoremap <leader>gs :lua require('telescope.builtin').git_status()<CR> nnoremap <leader>rc :lua require('alpha.telescope').search_config()<CR> diff --git a/plugin/treesitter.vim b/plugin/treesitter.vim new file mode 100644 index 0000000..57d0b01 --- /dev/null +++ b/plugin/treesitter.vim @@ -0,0 +1,28 @@ +lua << EOF + +require "nvim-treesitter.configs".setup { + highlight = { + enable = true, + additional_vim_regex_highlighting = false, + }, + 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 |