Compare commits
	
		
			25 Commits
		
	
	
		
			6c368d484e
			...
			legacy
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| d97244ca10 | |||
| af404f2329 | |||
| 7c09124f3d | |||
| b2fe474605 | |||
| b087eaa1ef | |||
| d6ce80e6a2 | |||
| 7375e269bc | |||
| 2b7b3c8662 | |||
| f4a9d3bd45 | |||
| e885214f90 | |||
| a4fc7253ad | |||
| cb15af601e | |||
| ba37880940 | |||
| 2345488cc8 | |||
| 6099693109 | |||
| 47d786ff47 | |||
| 13a695c846 | |||
| b86fd44312 | |||
| 6641160b9b | |||
| f40141a9ee | |||
| eebff3862d | |||
| a5972cdfd2 | |||
| 417197d303 | |||
| be676d0b07 | |||
| 08d8379bbe | 
							
								
								
									
										58
									
								
								init.lua
									
									
									
									
									
								
							
							
						
						
									
										58
									
								
								init.lua
									
									
									
									
									
								
							| @@ -19,11 +19,63 @@ if not vim.loop.fs_stat(lazypath) then | ||||
| end | ||||
| vim.opt.rtp:prepend(lazypath) | ||||
|  | ||||
| require 'options' | ||||
| require 'autocmd' | ||||
| require 'keymaps' | ||||
|  | ||||
| require('lazy').setup({ | ||||
|   { import = 'options' }, | ||||
|   { import = 'keymaps' }, | ||||
|   { | ||||
|     -- NOTE: Theme | ||||
|     'sainnhe/gruvbox-material', | ||||
|     priority = 1000, | ||||
|     lazy = false, | ||||
|     config = function() | ||||
|       vim.o.background = 'dark' | ||||
|       vim.g.gruvbox_material_background = 'light' | ||||
|       vim.g.gruvbox_material_better_performance = 1 | ||||
|       vim.g.gruvbox_material_diagnostic_line_highlight = 1 | ||||
|       vim.g.gruvbox_material_diagnostic_virtual_text = 'colored' | ||||
|       vim.g.gruvbox_material_enable_bold = 1 | ||||
|       vim.g.gruvbox_material_enable_italic = 1 | ||||
|       vim.cmd.colorscheme 'gruvbox-material' | ||||
|       -- changing bg and border colors | ||||
|       vim.api.nvim_set_hl(0, 'FloatBorder', { link = 'Normal' }) | ||||
|       vim.api.nvim_set_hl(0, 'LspInfoBorder', { link = 'Normal' }) | ||||
|       vim.api.nvim_set_hl(0, 'NormalFloat', { link = 'Normal' }) | ||||
|     end, | ||||
|   }, | ||||
|  | ||||
|   -- NOTE: First, some plugins that don't require any configuration | ||||
|  | ||||
|   -- Git related plugins | ||||
|   'tpope/vim-fugitive', | ||||
|   'tpope/vim-rhubarb', | ||||
|  | ||||
|   -- Detect tabstop and shiftwidth automatically | ||||
|   'tpope/vim-sleuth', | ||||
|  | ||||
|   -- NOTE: Second, plugins that require setup call (done via opts) | ||||
|  | ||||
|   -- Useful plugin to show you pending keybinds. | ||||
|   { 'folke/which-key.nvim', opts = {} }, | ||||
|  | ||||
|   -- "gc" to comment visual regions/lines | ||||
|   { 'numToStr/Comment.nvim', opts = {} }, | ||||
|  | ||||
|   -- colorize in files | ||||
|   { 'norcalli/nvim-colorizer.lua', opts = {} }, | ||||
|  | ||||
|   -- autopairs on newline | ||||
|   { 'windwp/nvim-autopairs', opts = {} }, | ||||
|  | ||||
|   -- highlighting for comments | ||||
|   { 'folke/todo-comments.nvim', dependencies = 'nvim-lua/plenary.nvim', opts = {} }, | ||||
|  | ||||
|   -- cargo crates | ||||
|   { 'saecki/crates.nvim', dependencies = 'nvim-lua/plenary.nvim', opts = {} }, | ||||
|  | ||||
|   -- import other plugins | ||||
|   { import = 'plugins' }, | ||||
|   { import = 'autocmd' }, | ||||
| }, {}) | ||||
|  | ||||
| -- The line beneath this is called `modeline`. See `:help modeline` | ||||
|   | ||||
| @@ -1,6 +1,29 @@ | ||||
| vim.api.nvim_create_autocmd({ 'BufEnter, BufWinEnter' }, { command = 'set colorcolumn=120,80,88', pattern = { '*.py', '*.pyi' } }) | ||||
| vim.api.nvim_create_autocmd({ 'BufEnter, BufWinEnter' }, { command = 'set colorcolumn=80,100', pattern = { '*.rs' } }) | ||||
| vim.api.nvim_create_autocmd({ 'BufEnter, BufWinEnter' }, { command = 'set splitright', pattern = { '*' } }) | ||||
| vim.api.nvim_create_autocmd({ 'BufEnter, BufWinEnter' }, { command = 'set splitbelow', pattern = { '*' } }) | ||||
| vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWinEnter' }, { command = 'set colorcolumn=79,80,88,120', pattern = { '*.py', '*.pyi' } }) | ||||
| vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWinEnter' }, { command = 'set colorcolumn=80,100', pattern = { '*.rs' } }) | ||||
| vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWinEnter' }, { command = 'set splitright', pattern = { '*' } }) | ||||
| vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWinEnter' }, { command = 'set splitbelow', pattern = { '*' } }) | ||||
|  | ||||
| return {} | ||||
| -- [[ Highlight on yank ]] | ||||
| -- See `:help vim.highlight.on_yank()` | ||||
| local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true }) | ||||
| vim.api.nvim_create_autocmd('TextYankPost', { | ||||
|   callback = function() | ||||
|     vim.highlight.on_yank() | ||||
|   end, | ||||
|   group = highlight_group, | ||||
|   pattern = '*', | ||||
| }) | ||||
|  | ||||
| vim.api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, { | ||||
|   pattern = '*.gitlab-ci*.{yml,yaml}', | ||||
|   callback = function() | ||||
|     vim.bo.filetype = 'yaml.gitlab' | ||||
|   end, | ||||
| }) | ||||
|  | ||||
| vim.api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, { | ||||
|   pattern = vim.fn.expand '~' .. '/.ssh/config.d/*.config', | ||||
|   callback = function() | ||||
|     vim.bo.filetype = 'sshconfig' | ||||
|   end, | ||||
| }) | ||||
|   | ||||
| @@ -18,18 +18,7 @@ vim.keymap.set('n', 'N', 'Nzzzv', { noremap = true, silent = true }) | ||||
|  | ||||
| -- Remap for moving selected line / block of text in visual mode | ||||
| vim.keymap.set('v', '<M-k>', ":m '<-2<cr>gv=gv", { desc = 'Move selected lines up' }) | ||||
| vim.keymap.set('v', '<M-j>', ":m '>+1<cr>gv=gv", { desc = 'move selected lines down' }) | ||||
|  | ||||
| -- [[ Highlight on yank ]] | ||||
| -- See `:help vim.highlight.on_yank()` | ||||
| local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true }) | ||||
| vim.api.nvim_create_autocmd('TextYankPost', { | ||||
|   callback = function() | ||||
|     vim.highlight.on_yank() | ||||
|   end, | ||||
|   group = highlight_group, | ||||
|   pattern = '*', | ||||
| }) | ||||
| vim.keymap.set('v', '<M-j>', ":m '>+1<cr>gv=gv", { desc = 'Move selected lines down' }) | ||||
|  | ||||
| -- Diagnostic keymaps | ||||
| vim.keymap.set('n', '[d', vim.diagnostic.goto_prev) | ||||
| @@ -37,18 +26,8 @@ vim.keymap.set('n', ']d', vim.diagnostic.goto_next) | ||||
| vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float) | ||||
| vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist) | ||||
|  | ||||
| -- terminal keymaps | ||||
| function _G.set_terminal_keymaps() | ||||
|   local opts = { buffer = 0 } | ||||
|   vim.keymap.set('t', '<esc>', [[<C-\><C-n>]], opts) | ||||
|   vim.keymap.set('t', '<C-h>', [[<Cmd>wincmd h<CR>]], opts) | ||||
|   vim.keymap.set('t', '<C-j>', [[<Cmd>wincmd j<CR>]], opts) | ||||
|   vim.keymap.set('t', '<C-k>', [[<Cmd>wincmd k<CR>]], opts) | ||||
|   vim.keymap.set('t', '<C-l>', [[<Cmd>wincmd l<CR>]], opts) | ||||
| end | ||||
| -- terminal | ||||
| vim.keymap.set('t', '<C-x>', vim.api.nvim_replace_termcodes('<C-\\><C-N>', true, true, true), { desc = 'Escape terminal mode' }) | ||||
|  | ||||
| -- | ||||
| -- if you only want these mappings for toggle term use term://*toggleterm#* instead | ||||
| vim.cmd 'autocmd! TermOpen term://* lua set_terminal_keymaps()' | ||||
|  | ||||
| return {} | ||||
| -- disabling highlight | ||||
| vim.keymap.set('n', '<leader>hh', ':noh<CR>', { desc = 'No highlight search' }) | ||||
|   | ||||
| @@ -6,7 +6,7 @@ vim.g.loaded_netrw = 1 | ||||
| vim.g.loaded_netrwPlugin = 1 | ||||
|  | ||||
| -- Set highlight on search | ||||
| vim.o.hlsearch = false | ||||
| vim.o.hlsearch = true | ||||
|  | ||||
| -- Make line numbers default | ||||
| vim.wo.number = true | ||||
| @@ -14,9 +14,6 @@ vim.wo.number = true | ||||
| -- Make line numbers relative | ||||
| vim.wo.relativenumber = true | ||||
|  | ||||
| -- Enable mouse mode | ||||
| vim.o.mouse = 'a' | ||||
|  | ||||
| -- Enable break indent | ||||
| vim.o.breakindent = true | ||||
|  | ||||
| @@ -40,4 +37,9 @@ vim.o.completeopt = 'menuone,noselect' | ||||
|  | ||||
| vim.o.termguicolors = true | ||||
|  | ||||
| return {} | ||||
| -- eol chars | ||||
| vim.opt.list = true | ||||
| vim.opt.listchars = { | ||||
|   eol = '', | ||||
|   tab = '<->', | ||||
| } | ||||
|   | ||||
							
								
								
									
										59
									
								
								lua/plugins/alpha.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										59
									
								
								lua/plugins/alpha.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,59 @@ | ||||
| return { | ||||
|   'goolord/alpha-nvim', | ||||
|   dependencies = { | ||||
|     'nvim-tree/nvim-web-devicons', | ||||
|   }, | ||||
|  | ||||
|   config = function() | ||||
|     local alpha = require 'alpha' | ||||
|     local dashboard = require 'alpha.themes.dashboard' | ||||
|  | ||||
|     dashboard.section.header.val = { | ||||
|       [[                                                                       ]], | ||||
|       [[                                                                       ]], | ||||
|       [[                                                                       ]], | ||||
|       [[                                                                       ]], | ||||
|       [[                                                                       ]], | ||||
|       [[                                                                       ]], | ||||
|       [[                                                                       ]], | ||||
|       [[                                                                       ]], | ||||
|       [[                                                                       ]], | ||||
|       [[                                                                       ]], | ||||
|       [[                                                                       ]], | ||||
|       [[                                                                       ]], | ||||
|       [[                                                                     ]], | ||||
|       [[       ████ ██████           █████      ██                     ]], | ||||
|       [[      ███████████             █████                             ]], | ||||
|       [[      █████████ ███████████████████ ███   ███████████   ]], | ||||
|       [[     █████████  ███    █████████████ █████ ██████████████   ]], | ||||
|       [[    █████████ ██████████ █████████ █████ █████ ████ █████   ]], | ||||
|       [[  ███████████ ███    ███ █████████ █████ █████ ████ █████  ]], | ||||
|       [[ ██████  █████████████████████ ████ █████ █████ ████ ██████ ]], | ||||
|       [[                                                                       ]], | ||||
|       [[                                                                       ]], | ||||
|       [[                                                                       ]], | ||||
|     } | ||||
|  | ||||
|     dashboard.section.buttons.val = { | ||||
|       dashboard.button('e', 'New file', '<cmd>ene <CR>'), | ||||
|       dashboard.button('SPC s f', 'Search files'), | ||||
|       dashboard.button('SPC s g', 'Search grep'), | ||||
|       dashboard.button('SPC s r', 'Search resume'), | ||||
|       dashboard.button('SPC SPC', 'Open buffers'), | ||||
|       dashboard.button('SPC h t', 'Harpoon terminal'), | ||||
|     } | ||||
|     _Gopts = { | ||||
|       position = 'center', | ||||
|       hl = 'Type', | ||||
|     } | ||||
|  | ||||
|     local function footer() | ||||
|       return os.date 'It was %H:%M:%S when this buffer was opened on %d. %m. %Y, a %A in %B.' | ||||
|     end | ||||
|  | ||||
|     dashboard.section.footer.val = footer() | ||||
|  | ||||
|     dashboard.opts.opts.noautocmd = true | ||||
|     alpha.setup(dashboard.opts) | ||||
|   end, | ||||
| } | ||||
							
								
								
									
										7
									
								
								lua/plugins/circles.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								lua/plugins/circles.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | ||||
| return { | ||||
|   'projekt0n/circles.nvim', | ||||
|   dependencies = { 'nvim-tree/nvim-web-devicons' }, | ||||
|   opts = { | ||||
|     icons = { empty = '●', filled = '○', lsp_prefix = '●' }, | ||||
|   }, | ||||
| } | ||||
| @@ -1,87 +0,0 @@ | ||||
| function leave_snippet() | ||||
|   if | ||||
|     ((vim.v.event.old_mode == 's' and vim.v.event.new_mode == 'n') or vim.v.event.old_mode == 'i') | ||||
|     and require('luasnip').session.current_nodes[vim.api.nvim_get_current_buf()] | ||||
|     and not require('luasnip').session.jump_active | ||||
|   then | ||||
|     require('luasnip').unlink_current() | ||||
|   end | ||||
| end | ||||
|  | ||||
| local border = { | ||||
|   { '╭', 'CmpBorder' }, | ||||
|   { '─', 'CmpBorder' }, | ||||
|   { '╮', 'CmpBorder' }, | ||||
|   { '│', 'CmpBorder' }, | ||||
|   { '╯', 'CmpBorder' }, | ||||
|   { '─', 'CmpBorder' }, | ||||
|   { '╰', 'CmpBorder' }, | ||||
|   { '│', 'CmpBorder' }, | ||||
| } | ||||
|  | ||||
| vim.api.nvim_command [[ | ||||
|     autocmd ModeChanged * lua leave_snippet() | ||||
| ]] | ||||
|  | ||||
| return { | ||||
|   { | ||||
|     'hrsh7th/nvim-cmp', | ||||
|     dependencies = { | ||||
|       'hrsh7th/cmp-nvim-lsp', | ||||
|       'L3MON4D3/LuaSnip', | ||||
|       'saadparwaiz1/cmp_luasnip', | ||||
|     }, | ||||
|     config = function() | ||||
|       -- nvim-cmp setup | ||||
|       local cmp = require 'cmp' | ||||
|       local luasnip = require 'luasnip' | ||||
|  | ||||
|       luasnip.config.setup {} | ||||
|  | ||||
|       cmp.setup { | ||||
|         snippet = { | ||||
|           expand = function(args) | ||||
|             luasnip.lsp_expand(args.body) | ||||
|           end, | ||||
|         }, | ||||
|         mapping = cmp.mapping.preset.insert { | ||||
|           ['<C-d>'] = cmp.mapping.scroll_docs(-4), | ||||
|           ['<C-f>'] = cmp.mapping.scroll_docs(4), | ||||
|           ['<C-Space>'] = cmp.mapping.complete {}, | ||||
|           ['<CR>'] = cmp.mapping.confirm { | ||||
|             behavior = cmp.ConfirmBehavior.Replace, | ||||
|             select = true, | ||||
|           }, | ||||
|           ['<Tab>'] = cmp.mapping(function(fallback) | ||||
|             if cmp.visible() then | ||||
|               cmp.select_next_item() | ||||
|             elseif luasnip.expand_or_jumpable() then | ||||
|               luasnip.expand_or_jump() | ||||
|             else | ||||
|               fallback() | ||||
|             end | ||||
|           end, { 'i', 's' }), | ||||
|           ['<S-Tab>'] = cmp.mapping(function(fallback) | ||||
|             if cmp.visible() then | ||||
|               cmp.select_prev_item() | ||||
|             elseif luasnip.jumpable(-1) then | ||||
|               luasnip.jump(-1) | ||||
|             else | ||||
|               fallback() | ||||
|             end | ||||
|           end, { 'i', 's' }), | ||||
|         }, | ||||
|         sources = { | ||||
|           { name = 'nvim_lsp' }, | ||||
|           { name = 'luasnip' }, | ||||
|           { name = 'crates' }, | ||||
|         }, | ||||
|         window = { | ||||
|           completion = { | ||||
|             border = border, | ||||
|           }, | ||||
|         }, | ||||
|       } | ||||
|     end, | ||||
|   }, | ||||
| } | ||||
| @@ -1,195 +0,0 @@ | ||||
| return { | ||||
|   -- NOTE: Theme | ||||
|   { | ||||
|     'sainnhe/gruvbox-material', | ||||
|     priority = 1000, | ||||
|     lazy = false, | ||||
|     config = function() | ||||
|       vim.g.gruvbox_material_background = 'soft' | ||||
|       vim.g.gruvbox_material_better_performance = 1 | ||||
|       vim.g.gruvbox_material_enable_italic = 1 | ||||
|  | ||||
|       vim.cmd.colorscheme 'gruvbox-material' | ||||
|     end, | ||||
|   }, | ||||
|  | ||||
|   -- NOTE: First, some plugins that don't require any configuration | ||||
|  | ||||
|   -- Git related plugins | ||||
|   'tpope/vim-fugitive', | ||||
|   'tpope/vim-rhubarb', | ||||
|  | ||||
|   -- Detect tabstop and shiftwidth automatically | ||||
|   'tpope/vim-sleuth', | ||||
|  | ||||
|   -- NOTE: Second, plugins that require setup call (done via opts) | ||||
|  | ||||
|   -- Useful plugin to show you pending keybinds. | ||||
|   { 'folke/which-key.nvim', opts = {} }, | ||||
|  | ||||
|   -- "gc" to comment visual regions/lines | ||||
|   { 'numToStr/Comment.nvim', opts = {} }, | ||||
|  | ||||
|   -- colorize in files | ||||
|   { 'norcalli/nvim-colorizer.lua', opts = {} }, | ||||
|  | ||||
|   -- autopairs on newline | ||||
|   { 'windwp/nvim-autopairs', opts = {} }, | ||||
|  | ||||
|   -- highlighting for comments | ||||
|   { 'folke/todo-comments.nvim', dependencies = 'nvim-lua/plenary.nvim', opts = {} }, | ||||
|  | ||||
|   -- cargo crates | ||||
|   { 'saecki/crates.nvim', dependencies = 'nvim-lua/plenary.nvim', opts = {} }, | ||||
|  | ||||
|   -- newage search plugin | ||||
|   { | ||||
|     'ggandor/leap.nvim', | ||||
|     dependencies = { 'tpope/vim-repeat' }, | ||||
|     config = function() | ||||
|       require('leap').add_default_mappings() | ||||
|     end, | ||||
|   }, | ||||
|  | ||||
|   -- permanent links to fileranges | ||||
|   { | ||||
|     'ruifm/gitlinker.nvim', | ||||
|     config = function() | ||||
|       require('gitlinker').setup { | ||||
|         callbacks = { | ||||
|           ['git.aflabs.org'] = require('gitlinker.hosts').get_gitlab_type_url, | ||||
|         }, | ||||
|       } | ||||
|     end, | ||||
|   }, | ||||
|  | ||||
|   -- NOTE: Third, plugins that require some setup, but not enugh for separate file | ||||
|  | ||||
|   { | ||||
|     -- Adds git releated signs to the gutter, as well as utilities for managing changes | ||||
|     'lewis6991/gitsigns.nvim', | ||||
|     opts = { | ||||
|       -- See `:help gitsigns.txt` | ||||
|       signs = { | ||||
|         add = { text = '+' }, | ||||
|         change = { text = '~' }, | ||||
|         delete = { text = '_' }, | ||||
|         topdelete = { text = '‾' }, | ||||
|         changedelete = { text = '~' }, | ||||
|       }, | ||||
|     }, | ||||
|   }, | ||||
|  | ||||
|   { | ||||
|     -- Set lualine as statusline | ||||
|     'nvim-lualine/lualine.nvim', | ||||
|     -- See `:help lualine.txt` | ||||
|     opts = { | ||||
|       options = { | ||||
|         icons_enabled = false, | ||||
|         theme = 'gruvbox-material', | ||||
|         statusline_style = 'mix', | ||||
|         component_separators = '|', | ||||
|         section_separators = '', | ||||
|       }, | ||||
|       sections = { | ||||
|         lualine_c = { | ||||
|           { | ||||
|             'filename', | ||||
|             file_status = true, | ||||
|             path = 1, | ||||
|           }, | ||||
|         }, | ||||
|       }, | ||||
|     }, | ||||
|   }, | ||||
|  | ||||
|   { | ||||
|     -- Add indentation guides even on blank lines | ||||
|     'lukas-reineke/indent-blankline.nvim', | ||||
|     -- Enable `lukas-reineke/indent-blankline.nvim` | ||||
|     -- See `:help indent_blankline.txt` | ||||
|     opts = { | ||||
|       char = '┊', | ||||
|       show_trailing_blankline_indent = false, | ||||
|     }, | ||||
|   }, | ||||
|  | ||||
|   { | ||||
|     -- git blame annotations | ||||
|     'f-person/git-blame.nvim', | ||||
|     init = function() | ||||
|       -- disable on startup | ||||
|       vim.g.gitblame_enabled = 0 | ||||
|     end, | ||||
|     config = function() | ||||
|       vim.api.nvim_set_keymap('n', '<leader>gt', ':GitBlameToggle<CR>', { desc = '[G]it Blame [T]oggle', noremap = true }) | ||||
|       vim.api.nvim_set_keymap('n', '<leader>gu', ':GitBlameOpenCommitURL<CR>', { desc = '[G]it Blame Open Commit [U]rl', noremap = true }) | ||||
|     end, | ||||
|   }, | ||||
|  | ||||
|   { | ||||
|     -- a more adventurous wildmenu | ||||
|     'gelguy/wilder.nvim', | ||||
|     dependencies = { 'romgrk/fzy-lua-native' }, | ||||
|     config = function() | ||||
|       local wilder = require 'wilder' | ||||
|       wilder.setup { modes = { ':', '/', '?' } } | ||||
|       -- Disable Python remote plugin | ||||
|       wilder.set_option('use_python_remote_plugin', 0) | ||||
|  | ||||
|       wilder.set_option('pipeline', { | ||||
|         wilder.branch( | ||||
|           wilder.cmdline_pipeline { | ||||
|             fuzzy = 1, | ||||
|             fuzzy_filter = wilder.lua_fzy_filter(), | ||||
|           }, | ||||
|           wilder.vim_search_pipeline() | ||||
|         ), | ||||
|       }) | ||||
|  | ||||
|       wilder.set_option( | ||||
|         'renderer', | ||||
|         wilder.popupmenu_renderer(wilder.popupmenu_border_theme { | ||||
|           highlights = { | ||||
|             border = 'Normal', | ||||
|           }, | ||||
|           border = 'rounded', | ||||
|           highlighter = wilder.lua_fzy_highlighter(), | ||||
|           left = { ' ', wilder.popupmenu_devicons() }, | ||||
|           right = { ' ', wilder.popupmenu_scrollbar() }, | ||||
|         }) | ||||
|       ) | ||||
|     end, | ||||
|   }, | ||||
|  | ||||
|   { | ||||
|     'projekt0n/circles.nvim', | ||||
|     dependencies = { 'nvim-tree/nvim-web-devicons' }, | ||||
|     opts = { | ||||
|       icons = { empty = '●', filled = '○', lsp_prefix = '●' }, | ||||
|     }, | ||||
|   }, | ||||
|  | ||||
|   -- file menu | ||||
|   { | ||||
|     'nvim-tree/nvim-tree.lua', | ||||
|     config = function() | ||||
|       require('nvim-tree').setup { | ||||
|         renderer = { | ||||
|           icons = { | ||||
|             glyphs = require('circles').get_nvimtree_glyphs(), | ||||
|           }, | ||||
|         }, | ||||
|         filters = { | ||||
|           custom = { | ||||
|             '__pycache__', | ||||
|           }, | ||||
|         }, | ||||
|         git = { | ||||
|           ignore = false, | ||||
|         }, | ||||
|       } | ||||
|     end, | ||||
|   }, | ||||
| } | ||||
							
								
								
									
										117
									
								
								lua/plugins/completions.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										117
									
								
								lua/plugins/completions.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,117 @@ | ||||
| -- function Leave_snippet() | ||||
| --   if | ||||
| --       ((vim.v.event.old_mode == 's' and vim.v.event.new_mode == 'n') or vim.v.event.old_mode == 'i') | ||||
| --       and require('luasnip').session.current_nodes[vim.api.nvim_get_current_buf()] | ||||
| --       and not require('luasnip').session.jump_active | ||||
| --   then | ||||
| --     require('luasnip').unlink_current() | ||||
| --   end | ||||
| -- end | ||||
| -- | ||||
| -- vim.api.nvim_command [[ | ||||
| --     autocmd ModeChanged * lua Leave_snippet() | ||||
| -- ]] | ||||
| -- | ||||
| -- vim.cmd 'highlight! link CmpPmenu         Pmenu' | ||||
| -- vim.cmd 'highlight! link CmpPmenuBorder   Pmenu' | ||||
| -- vim.cmd 'highlight! CmpPmenu         guibg=#282828' | ||||
| -- vim.cmd 'highlight! CmpPmenuBorder   guifg=#615750' | ||||
|  | ||||
| return { | ||||
|   { | ||||
|     'hrsh7th/nvim-cmp', | ||||
|     event = 'InsertEnter', | ||||
|     dependencies = { | ||||
|       -- Snippet Engine & its associated nvim-cmp source | ||||
|       { | ||||
|         'L3MON4D3/LuaSnip', | ||||
|         build = (function() | ||||
|           -- Build Step is needed for regex support in snippets. | ||||
|           -- This step is not supported in many windows environments. | ||||
|           -- Remove the below condition to re-enable on windows. | ||||
|           if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then | ||||
|             return | ||||
|           end | ||||
|           return 'make install_jsregexp' | ||||
|         end)(), | ||||
|         dependencies = { | ||||
|           -- `friendly-snippets` contains a variety of premade snippets. | ||||
|           --    See the README about individual language/framework/plugin snippets: | ||||
|           --    https://github.com/rafamadriz/friendly-snippets | ||||
|           { | ||||
|             'rafamadriz/friendly-snippets', | ||||
|             config = function() | ||||
|               require('luasnip.loaders.from_vscode').lazy_load() | ||||
|             end, | ||||
|           }, | ||||
|         }, | ||||
|       }, | ||||
|       'saadparwaiz1/cmp_luasnip', | ||||
|  | ||||
|       -- Adds other completion capabilities. | ||||
|       --  nvim-cmp does not ship with all sources by default. They are split | ||||
|       --  into multiple repos for maintenance purposes. | ||||
|       'hrsh7th/cmp-nvim-lsp', | ||||
|       'hrsh7th/cmp-path', | ||||
|     }, | ||||
|     config = function() | ||||
|       local cmp = require 'cmp' | ||||
|       local luasnip = require 'luasnip' | ||||
|       luasnip.config.setup {} | ||||
|  | ||||
|       local border = require('utils').nvim_open_win_border | ||||
|       local highlight_opts = 'Normal:CmpPmenu,FloatBorder:CmpPmenuBorder,CursorLine:PmenuSel,Search:None' | ||||
|  | ||||
|       cmp.setup { | ||||
|         snippet = { | ||||
|           expand = function(args) | ||||
|             luasnip.lsp_expand(args.body) | ||||
|           end, | ||||
|         }, | ||||
|         completion = { completeopt = 'menu,menuone,noinsert' }, | ||||
|  | ||||
|         mapping = cmp.mapping.preset.insert { | ||||
|           ['<C-n>'] = cmp.mapping.select_next_item(), | ||||
|           ['<C-p>'] = cmp.mapping.select_prev_item(), | ||||
|           ['<C-b>'] = cmp.mapping.scroll_docs(-4), | ||||
|           ['<C-f>'] = cmp.mapping.scroll_docs(4), | ||||
|           ['<C-y>'] = cmp.mapping.confirm { select = true }, | ||||
|           ['<C-Space>'] = cmp.mapping.complete {}, | ||||
|  | ||||
|           ['<C-l>'] = cmp.mapping(function() | ||||
|             if luasnip.expand_or_locally_jumpable() then | ||||
|               luasnip.expand_or_jump() | ||||
|             end | ||||
|           end, { 'i', 's' }), | ||||
|           ['<C-h>'] = cmp.mapping(function() | ||||
|             if luasnip.locally_jumpable(-1) then | ||||
|               luasnip.jump(-1) | ||||
|             end | ||||
|           end, { 'i', 's' }), | ||||
|         }, | ||||
|         sources = { | ||||
|           { | ||||
|             name = 'lazydev', | ||||
|             -- set group index to 0 to skip loading LuaLS completions as lazydev recommends it | ||||
|             group_index = 0, | ||||
|           }, | ||||
|           { name = 'nvim_lsp' }, | ||||
|           { name = 'luasnip' }, | ||||
|           { name = 'path' }, | ||||
|           -- { name = 'crates' }, | ||||
|         }, | ||||
|         window = { | ||||
|           completion = { | ||||
|             border = border 'CmpBorder', | ||||
|             side_padding = 1, | ||||
|             winhighlight = highlight_opts, | ||||
|           }, | ||||
|           documentation = { | ||||
|             border = border 'CmpDocBorder', | ||||
|             winhighlight = highlight_opts, | ||||
|           }, | ||||
|         }, | ||||
|       } | ||||
|     end, | ||||
|   }, | ||||
| } | ||||
							
								
								
									
										12
									
								
								lua/plugins/gitblame.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								lua/plugins/gitblame.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | ||||
| return { | ||||
|   -- git blame annotations | ||||
|   'f-person/git-blame.nvim', | ||||
|   init = function() | ||||
|     -- disable on startup | ||||
|     vim.g.gitblame_enabled = 0 | ||||
|   end, | ||||
|   config = function() | ||||
|     vim.api.nvim_set_keymap('n', '<leader>gt', ':GitBlameToggle<CR>', { desc = '[G]it Blame [T]oggle', noremap = true }) | ||||
|     vim.api.nvim_set_keymap('n', '<leader>gu', ':GitBlameOpenCommitURL<CR>', { desc = '[G]it Blame Open Commit [U]rl', noremap = true }) | ||||
|   end, | ||||
| } | ||||
							
								
								
									
										11
									
								
								lua/plugins/gitlinker.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								lua/plugins/gitlinker.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | ||||
| return { | ||||
|   'ruifm/gitlinker.nvim', | ||||
|   config = function() | ||||
|     require('gitlinker').setup { | ||||
|       callbacks = { | ||||
|         ['git.aflabs.org'] = require('gitlinker.hosts').get_gitlab_type_url, | ||||
|         ['git.janezic.dev'] = require('gitlinker.hosts').get_gitea_type_url, | ||||
|       }, | ||||
|     } | ||||
|   end, | ||||
| } | ||||
							
								
								
									
										14
									
								
								lua/plugins/gitsigns.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								lua/plugins/gitsigns.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,14 @@ | ||||
| return { | ||||
|   -- Adds git releated signs to the gutter, as well as utilities for managing changes | ||||
|   'lewis6991/gitsigns.nvim', | ||||
|   opts = { | ||||
|     -- See `:help gitsigns.txt` | ||||
|     signs = { | ||||
|       add = { text = '+' }, | ||||
|       change = { text = '~' }, | ||||
|       delete = { text = '_' }, | ||||
|       topdelete = { text = '‾' }, | ||||
|       changedelete = { text = '~' }, | ||||
|     }, | ||||
|   }, | ||||
| } | ||||
							
								
								
									
										8
									
								
								lua/plugins/indent_blankline.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								lua/plugins/indent_blankline.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | ||||
| return { | ||||
|   -- Add indentation guides even on blank lines | ||||
|   'lukas-reineke/indent-blankline.nvim', | ||||
|   -- Enable `lukas-reineke/indent-blankline.nvim` | ||||
|   -- See `:help indent_blankline.txt` | ||||
|   main = 'ibl', | ||||
|   opts = { scope = { show_start = false, show_end = false } }, | ||||
| } | ||||
| @@ -1,118 +1,150 @@ | ||||
| local on_attach = function(_, bufnr) | ||||
|   local nmap = function(keys, func, desc) | ||||
|     if desc then | ||||
|       desc = 'LSP: ' .. desc | ||||
|     end | ||||
|     vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc }) | ||||
| vim.api.nvim_create_autocmd('LspAttach', { | ||||
|   group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }), | ||||
|   callback = function(event) | ||||
|     local map = function(keys, func, desc, mode) | ||||
|       mode = mode or 'n' | ||||
|       vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc }) | ||||
|     end | ||||
|  | ||||
|     map('<leader>D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition') | ||||
|     map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction', { 'n', 'x' }) | ||||
|     map('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols') | ||||
|     map('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame') | ||||
|     map('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols') | ||||
|     map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') | ||||
|     map('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation') | ||||
|     map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') | ||||
|     map('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') | ||||
|  | ||||
|     local delayed_format = function() | ||||
|       vim.lsp.buf.format { timeout_ms = 2000 } | ||||
|     end | ||||
|  | ||||
|   nmap('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame') | ||||
|   nmap('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction') | ||||
|   nmap('<leader>ff', delayed_format, '[F]ormat') | ||||
|     map('<leader>ff', delayed_format, '[F]ormat') | ||||
|     -- | ||||
|     -- -- See `:help K` for why this keymap | ||||
|     -- nmap('K', vim.lsp.buf.hover, 'Hover Documentation') | ||||
|     -- nmap('<C-k>', vim.lsp.buf.signature_help, 'Signature Documentation') | ||||
|  | ||||
|   nmap('gd', vim.lsp.buf.definition, '[G]oto [D]efinition') | ||||
|   nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') | ||||
|   nmap('gI', vim.lsp.buf.implementation, '[G]oto [I]mplementation') | ||||
|   nmap('<leader>D', vim.lsp.buf.type_definition, 'Type [D]efinition') | ||||
|   nmap('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols') | ||||
|   nmap('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols') | ||||
|     local client = vim.lsp.get_client_by_id(event.data.client_id) | ||||
|     if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then | ||||
|       local highlight_augroup = vim.api.nvim_create_augroup('kickstart-lsp-highlight', { clear = false }) | ||||
|       vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, { | ||||
|         buffer = event.buf, | ||||
|         group = highlight_augroup, | ||||
|         callback = vim.lsp.buf.document_highlight, | ||||
|       }) | ||||
|  | ||||
|   -- See `:help K` for why this keymap | ||||
|   nmap('K', vim.lsp.buf.hover, 'Hover Documentation') | ||||
|   nmap('<C-k>', vim.lsp.buf.signature_help, 'Signature Documentation') | ||||
|       vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, { | ||||
|         buffer = event.buf, | ||||
|         group = highlight_augroup, | ||||
|         callback = vim.lsp.buf.clear_references, | ||||
|       }) | ||||
|  | ||||
|   -- Lesser used LSP functionality | ||||
|   nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') | ||||
|   nmap('<leader>wa', vim.lsp.buf.add_workspace_folder, '[W]orkspace [A]dd Folder') | ||||
|   nmap('<leader>wr', vim.lsp.buf.remove_workspace_folder, '[W]orkspace [R]emove Folder') | ||||
|   nmap('<leader>wl', function() | ||||
|     print(vim.inspect(vim.lsp.buf.list_workspace_folders())) | ||||
|   end, '[W]orkspace [L]ist Folders') | ||||
|       vim.api.nvim_create_autocmd('LspDetach', { | ||||
|         group = vim.api.nvim_create_augroup('kickstart-lsp-detach', { clear = true }), | ||||
|         callback = function(event2) | ||||
|           vim.lsp.buf.clear_references() | ||||
|           vim.api.nvim_clear_autocmds { group = 'kickstart-lsp-highlight', buffer = event2.buf } | ||||
|         end, | ||||
|       }) | ||||
|     end | ||||
|  | ||||
|   -- Create a command `:Format` local to the LSP buffer | ||||
|   vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_) | ||||
|     vim.lsp.buf.format() | ||||
|   end, { desc = 'Format current buffer with LSP' }) | ||||
| end | ||||
|     if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then | ||||
|       map('<leader>th', function() | ||||
|         vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) | ||||
|       end, '[T]oggle Inlay [H]ints') | ||||
|     end | ||||
|   end, | ||||
| }) | ||||
|  | ||||
| return { | ||||
|   { | ||||
|     -- LSP Configuration & Plugins | ||||
|     'neovim/nvim-lspconfig', | ||||
|     dependencies = { | ||||
|       -- Automatically install LSPs to stdpath for neovim | ||||
|       'williamboman/mason.nvim', | ||||
|  | ||||
|       -- Automatically install LSPs and related tools to stdpath for Neovim | ||||
|       { 'williamboman/mason.nvim', config = true }, -- NOTE: Must be loaded before dependants | ||||
|       'williamboman/mason-lspconfig.nvim', | ||||
|       'WhoIsSethDaniel/mason-tool-installer.nvim', | ||||
|  | ||||
|       -- adds extra functionality over rust_analyzer | ||||
|       'simrat39/rust-tools.nvim', | ||||
|  | ||||
|       -- Useful status updates for LSP | ||||
|       -- Useful status updates for LSP. | ||||
|       { 'j-hui/fidget.nvim', opts = {} }, | ||||
|  | ||||
|       -- Additional lua configuration, makes nvim stuff amazing! | ||||
|       'folke/neodev.nvim', | ||||
|       -- Allows extra capabilities provided by nvim-cmp | ||||
|       'hrsh7th/cmp-nvim-lsp', | ||||
|  | ||||
|       { | ||||
|         'mrcjkb/rustaceanvim', | ||||
|         version = '^4', | ||||
|         ft = { 'rust' }, | ||||
|       }, | ||||
|  | ||||
|       { | ||||
|         -- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins | ||||
|         -- used for completion, annotations and signatures of Neovim apis | ||||
|         'folke/lazydev.nvim', | ||||
|         ft = 'lua', | ||||
|         opts = { | ||||
|           library = { | ||||
|             -- Load luvit types when the `vim.uv` word is found | ||||
|             { path = 'luvit-meta/library', words = { 'vim%.uv' } }, | ||||
|           }, | ||||
|         }, | ||||
|       }, | ||||
|       { 'Bilal2453/luvit-meta', lazy = true }, | ||||
|     }, | ||||
|     config = function() | ||||
|       local servers = { | ||||
|         clangd = {}, | ||||
|         gopls = {}, | ||||
|         marksman = {}, | ||||
|         pyright = {}, | ||||
|         tsserver = {}, | ||||
|         gopls = {}, | ||||
|         ruff = {}, | ||||
|         pyright = { | ||||
|           pyright = { | ||||
|             disableOrganizeImports = true, | ||||
|           }, | ||||
|         }, | ||||
|         ts_ls = {}, | ||||
|         lua_ls = { | ||||
|           Lua = { | ||||
|             workspace = { checkThirdParty = false }, | ||||
|             telemetry = { enable = false }, | ||||
|           }, | ||||
|         }, | ||||
|         stylua = {}, | ||||
|       } | ||||
|  | ||||
|       -- Setup neovim lua configuration | ||||
|       require('neodev').setup() | ||||
|  | ||||
|       -- nvim-cmp supports additional completion capabilities, so broadcast that to servers | ||||
|       local capabilities = vim.lsp.protocol.make_client_capabilities() | ||||
|       capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) | ||||
|       capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities()) | ||||
|  | ||||
|       -- Setup mason so it can manage external tooling | ||||
|       require('mason').setup() | ||||
|  | ||||
|       -- Ensure the servers above are installed | ||||
|       local mason_lspconfig = require 'mason-lspconfig' | ||||
|       require('mason-tool-installer').setup { ensure_installed = vim.tbl_keys(servers) } | ||||
|  | ||||
|       mason_lspconfig.setup { | ||||
|         ensure_installed = vim.tbl_keys(servers), | ||||
|       } | ||||
|  | ||||
|       mason_lspconfig.setup_handlers { | ||||
|       require('mason-lspconfig').setup { | ||||
|         handlers = { | ||||
|           function(server_name) | ||||
|           require('lspconfig')[server_name].setup { | ||||
|             capabilities = capabilities, | ||||
|             on_attach = on_attach, | ||||
|             settings = servers[server_name], | ||||
|           } | ||||
|             local server = servers[server_name] or {} | ||||
|             -- This handles overriding only values explicitly passed | ||||
|             -- by the server configuration above. Useful when disabling | ||||
|             -- certain features of an LSP (for example, turning off formatting for ts_ls) | ||||
|             server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {}) | ||||
|             require('lspconfig')[server_name].setup(server) | ||||
|           end, | ||||
|         }, | ||||
|       } | ||||
|  | ||||
|       local rust_tools_opts = { | ||||
|       vim.g.rustaceanvim = { | ||||
|         tools = { | ||||
|           runnables = { | ||||
|             use_telescope = true, | ||||
|           }, | ||||
|           inlay_hints = { | ||||
|             auto = true, | ||||
|             show_parameter_hints = false, | ||||
|             parameter_hints_prefix = '', | ||||
|             other_hints_prefix = '', | ||||
|             auto = false, | ||||
|           }, | ||||
|         }, | ||||
|         server = { | ||||
|           on_attach = on_attach, | ||||
|           settings = { | ||||
|             ['rust-analyzer'] = { | ||||
|               cargo = { | ||||
| @@ -123,12 +155,17 @@ return { | ||||
|               checkOnSave = { | ||||
|                 command = 'clippy', | ||||
|               }, | ||||
|               -- leave rainbow higlight to plugin | ||||
|               rainbowHighlightOn = false, | ||||
|               useLibraryCodeForTypes = true, | ||||
|               autoSearchPaths = true, | ||||
|               autoImportCompletions = false, | ||||
|               reportMissingImports = true, | ||||
|               followImportForHints = true, | ||||
|             }, | ||||
|           }, | ||||
|         }, | ||||
|       } | ||||
|  | ||||
|       require('rust-tools').setup(rust_tools_opts) | ||||
|     end, | ||||
|   }, | ||||
| } | ||||
|   | ||||
							
								
								
									
										21
									
								
								lua/plugins/lualine.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								lua/plugins/lualine.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,21 @@ | ||||
| return { | ||||
|   'nvim-lualine/lualine.nvim', | ||||
|   opts = { | ||||
|     options = { | ||||
|       icons_enabled = false, | ||||
|       theme = 'gruvbox-material', | ||||
|       statusline_style = 'mix', | ||||
|       component_separators = '|', | ||||
|       section_separators = '', | ||||
|     }, | ||||
|     sections = { | ||||
|       lualine_c = { | ||||
|         { | ||||
|           'filename', | ||||
|           file_status = true, | ||||
|           path = 1, | ||||
|         }, | ||||
|       }, | ||||
|     }, | ||||
|   }, | ||||
| } | ||||
| @@ -1,15 +0,0 @@ | ||||
| return { | ||||
|   'SmiteshP/nvim-navbuddy', | ||||
|   dependencies = { | ||||
|     'neovim/nvim-lspconfig', | ||||
|     'SmiteshP/nvim-navic', | ||||
|     'MunifTanjim/nui.nvim', | ||||
|   }, | ||||
|   config = function() | ||||
|     require('nvim-navbuddy').setup { lsp = { auto_attach = true } } | ||||
|  | ||||
|     -- Plugins | ||||
|     vim.keymap.set('n', '<leader>nb', ':Navbuddy<CR>', { desc = '[N]av[b]uddy' }) | ||||
|     vim.keymap.set('n', '<leader>nt', ':NvimTreeToggle<CR>', { desc = '[N]vim[T]ree' }) | ||||
|   end, | ||||
| } | ||||
							
								
								
									
										6
									
								
								lua/plugins/neogen.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								lua/plugins/neogen.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,6 @@ | ||||
| return { | ||||
|   'danymat/neogen', | ||||
|   config = true, | ||||
|   -- Uncomment next line if you want to follow only stable versions | ||||
|   -- version = "*" | ||||
| } | ||||
							
								
								
									
										23
									
								
								lua/plugins/none_ls.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								lua/plugins/none_ls.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,23 @@ | ||||
| return { | ||||
|   -- inject lsp formatting, diagonstics etc | ||||
|   'nvimtools/none-ls.nvim', | ||||
|   dependencies = { | ||||
|     'nvim-lua/plenary.nvim', | ||||
|   }, | ||||
|   config = function() | ||||
|     local none_ls = require 'null-ls' | ||||
|  | ||||
|     none_ls.setup { | ||||
|       sources = { | ||||
|         -- general | ||||
|         none_ls.builtins.code_actions.gitsigns, | ||||
|         -- python | ||||
|         -- none_ls.builtins.formatting.black, | ||||
|         -- typescript | ||||
|         none_ls.builtins.formatting.prettier, | ||||
|         -- lua | ||||
|         none_ls.builtins.formatting.stylua, | ||||
|       }, | ||||
|     } | ||||
|   end, | ||||
| } | ||||
| @@ -1,23 +0,0 @@ | ||||
| return { | ||||
|   -- inject lsp formatting, diagonstics etc | ||||
|   'jose-elias-alvarez/null-ls.nvim', | ||||
|   dependencies = { 'nvim-lua/plenary.nvim' }, | ||||
|   config = function() | ||||
|     local null_ls = require 'null-ls' | ||||
|  | ||||
|     null_ls.setup { | ||||
|       sources = { | ||||
|         -- general | ||||
|         null_ls.builtins.code_actions.gitsigns, | ||||
|         -- python | ||||
|         -- null_ls.builtins.diagnostics.pylint, | ||||
|         null_ls.builtins.formatting.black, | ||||
|         null_ls.builtins.formatting.isort, | ||||
|         -- typescript | ||||
|         null_ls.builtins.formatting.prettier, | ||||
|         -- lua | ||||
|         null_ls.builtins.formatting.stylua, | ||||
|       }, | ||||
|     } | ||||
|   end, | ||||
| } | ||||
							
								
								
									
										8
									
								
								lua/plugins/oil.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								lua/plugins/oil.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | ||||
| return { | ||||
|   'stevearc/oil.nvim', | ||||
|   dependencies = { 'nvim-tree/nvim-web-devicons' }, | ||||
|   config = function() | ||||
|     require('oil').setup { view_options = { show_hidden = true } } | ||||
|     vim.keymap.set('n', '-', require('oil').open, { desc = 'Open parent directory' }) | ||||
|   end, | ||||
| } | ||||
							
								
								
									
										3
									
								
								lua/plugins/rainbow-delimiters.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								lua/plugins/rainbow-delimiters.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,3 @@ | ||||
| return { | ||||
|   'HiPhish/rainbow-delimiters.nvim', | ||||
| } | ||||
| @@ -3,14 +3,11 @@ return { | ||||
|   { | ||||
|     -- Fuzzy Finder (files, lsp, etc) | ||||
|     'nvim-telescope/telescope.nvim', | ||||
|     version = '*', | ||||
|     branch = '0.1.x', | ||||
|     dependencies = { | ||||
|       'nvim-lua/plenary.nvim', | ||||
|  | ||||
|       { | ||||
|         'nvim-telescope/telescope-fzf-native.nvim', | ||||
|         -- NOTE: If you are having trouble with this installation, | ||||
|         --       refer to the README for telescope-fzf-native for more instructions. | ||||
|         build = 'make', | ||||
|         cond = function() | ||||
|           return vim.fn.executable 'make' == 1 | ||||
| @@ -18,43 +15,43 @@ return { | ||||
|       }, | ||||
|     }, | ||||
|     config = function() | ||||
|       local telescopeConfig = require 'telescope.config' | ||||
|  | ||||
|       -- Clone the default Telescope configuration | ||||
|       local vimgrep_arguments = { unpack(telescopeConfig.values.vimgrep_arguments) } | ||||
|  | ||||
|       -- I want to search in hidden/dot files. | ||||
|       table.insert(vimgrep_arguments, '--hidden') | ||||
|       -- I don't want to respect .gitignore but do want to respect .ignore | ||||
|       table.insert(vimgrep_arguments, '--no-ignore-vcs') | ||||
|       -- I don't want to search in the `.git` directory. | ||||
|       table.insert(vimgrep_arguments, '--glob') | ||||
|       table.insert(vimgrep_arguments, '!**/.git/*') | ||||
|  | ||||
|       local rg_defaults = { 'rg', '-S', '--hidden', '--no-ignore-vcs', '--glob', '!**/.git/*' } | ||||
|  | ||||
|       local find_command = { unpack(rg_defaults) } | ||||
|       table.insert(find_command, '--files') | ||||
|  | ||||
|       local grep_command = { unpack(rg_defaults) } | ||||
|       table.insert(grep_command, '--color=never') | ||||
|       table.insert(grep_command, '--no-heading') | ||||
|       table.insert(grep_command, '--with-filename') | ||||
|       table.insert(grep_command, '--line-number') | ||||
|       table.insert(grep_command, '--column') | ||||
|  | ||||
|       -- [[ Configure Telescope ]] | ||||
|       -- See `:help telescope` and `:help telescope.setup()` | ||||
|       require('telescope').setup { | ||||
|         defaults = { | ||||
|           mappings = { | ||||
|             i = { | ||||
|               ['<C-u>'] = false, | ||||
|               ['<C-d>'] = false, | ||||
|             }, | ||||
|           }, | ||||
|           vimgrep_arguments = vimgrep_arguments, | ||||
|         }, | ||||
|         pickers = { | ||||
|           find_files = { | ||||
|             find_command = { | ||||
|               'rg', | ||||
|               '-S', | ||||
|               '--no-ignore-vcs', | ||||
|               '--hidden', | ||||
|               '--files', | ||||
|               '-g', | ||||
|               '!.git', | ||||
|             }, | ||||
|             find_command = find_command, | ||||
|           }, | ||||
|           live_grep = { | ||||
|             grep_command = { | ||||
|               'rg', | ||||
|               '--no-ignore-vcs', | ||||
|               '--hidden', | ||||
|               '--color=never', | ||||
|               '--no-heading', | ||||
|               '--with-filename', | ||||
|               '--line-number', | ||||
|               '--column', | ||||
|               '--smart-case', | ||||
|               '-g', | ||||
|               '!.git', | ||||
|             }, | ||||
|             grep_command = grep_command, | ||||
|           }, | ||||
|         }, | ||||
|       } | ||||
| @@ -62,19 +59,9 @@ return { | ||||
|       -- Enable telescope fzf native, if installed | ||||
|       pcall(require('telescope').load_extension, 'fzf') | ||||
|  | ||||
|       -- Enable harpoon | ||||
|       require('telescope').load_extension 'harpoon' | ||||
|  | ||||
|       -- See `:help telescope.builtin` | ||||
|       vim.keymap.set('n', '<leader>?', require('telescope.builtin').oldfiles, { desc = '[?] Find recently opened files' }) | ||||
|       vim.keymap.set('n', '<leader><space>', require('telescope.builtin').buffers, { desc = '[ ] Find existing buffers' }) | ||||
|       vim.keymap.set('n', '<leader>/', function() | ||||
|         -- You can pass additional configuration to telescope to change theme, layout, etc. | ||||
|         require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { | ||||
|           winblend = 10, | ||||
|           previewer = false, | ||||
|         }) | ||||
|       end, { desc = '[/] Fuzzily search in current buffer' }) | ||||
|  | ||||
|       vim.keymap.set('n', '<leader>sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' }) | ||||
|       vim.keymap.set('n', '<leader>sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' }) | ||||
| @@ -82,18 +69,7 @@ return { | ||||
|       vim.keymap.set('n', '<leader>sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' }) | ||||
|       vim.keymap.set('n', '<leader>sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' }) | ||||
|       vim.keymap.set('n', '<leader>ss', require('telescope.builtin').spell_suggest, { desc = '[S]pell [S]suggest' }) | ||||
|  | ||||
|       vim.keymap.set('n', '<leader>sc', function() | ||||
|         require('telescope.builtin').colorscheme { enable_preview = true } | ||||
|       end, { desc = '[S]earch [C]olorscheme' }) | ||||
|  | ||||
|       -- extensions | ||||
|       vim.api.nvim_set_keymap('n', '<leader>tc', ':TodoTelescope<CR>', { desc = '[T]odo [c]omments', noremap = true }) | ||||
|       vim.api.nvim_set_keymap('n', '<leader>hm', ':Telescope harpoon marks<CR>', { desc = '[H]arpoon [m]arks', noremap = true }) | ||||
|       vim.keymap.set('n', '<leader>sr', require('telescope.builtin').resume, { desc = '[S]earch [R]esume' }) | ||||
|     end, | ||||
|   }, | ||||
|  | ||||
|   -- Fuzzy Finder Algorithm which requires local dependencies to be built. | ||||
|   -- Only load if `make` is available. Make sure you have the system | ||||
|   -- requirements installed. | ||||
| } | ||||
|   | ||||
| @@ -1,43 +1,43 @@ | ||||
| return { | ||||
|   -- Highlight, edit, and navigate code | ||||
|   'nvim-treesitter/nvim-treesitter', | ||||
|   dependencies = { | ||||
|     'nvim-treesitter/nvim-treesitter-textobjects', | ||||
|     'nvim-treesitter/nvim-treesitter-context', | ||||
|     'nvim-treesitter/nvim-treesitter-refactor', | ||||
|   }, | ||||
|   dependencies = { 'nvim-treesitter/nvim-treesitter-textobjects' }, | ||||
|   config = function() | ||||
|     pcall(require('nvim-treesitter.install').update { with_sync = true }) | ||||
|  | ||||
|     -- [[ Configure Treesitter ]] | ||||
|     -- See `:help nvim-treesitter` | ||||
|     vim.defer_fn(function() | ||||
|       require('nvim-treesitter.configs').setup { | ||||
|         -- Add languages to be installed here that you want installed for treesitter | ||||
|       ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'typescript', 'vimdoc', 'vim', 'markdown' }, | ||||
|         ensure_installed = { | ||||
|           'c', | ||||
|           'cpp', | ||||
|           'go', | ||||
|           'lua', | ||||
|           'python', | ||||
|           'rust', | ||||
|           'tsx', | ||||
|           'typescript', | ||||
|           'vimdoc', | ||||
|           'vim', | ||||
|           'markdown', | ||||
|         }, | ||||
|  | ||||
|         -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) | ||||
|         auto_install = true, | ||||
|  | ||||
|         highlight = { enable = true }, | ||||
|       indent = { enable = true, disable = { 'python' } }, | ||||
|         indent = { enable = true }, | ||||
|         incremental_selection = { | ||||
|           enable = true, | ||||
|           keymaps = { | ||||
|           init_selection = '<C-Space>', | ||||
|           node_incremental = '<C-Space>', | ||||
|           scope_incremental = '<C-Space>', | ||||
|           node_decremental = '<C-Bslash>', | ||||
|             init_selection = '<c-space>', | ||||
|             node_incremental = '<c-space>', | ||||
|             scope_incremental = '<c-M-space>', | ||||
|             node_decremental = '<c-bslash>', | ||||
|           }, | ||||
|         }, | ||||
|       -- rainbow | ||||
|       rainbow = { | ||||
|         enable = true, | ||||
|         extended_mode = true, | ||||
|       }, | ||||
|       -- refactor | ||||
|       refactor = { | ||||
|         highlight_definitions = { enable = true, clear_on_cursor_move = true }, | ||||
|       }, | ||||
|         -- textobjects | ||||
|         textobjects = { | ||||
|           select = { | ||||
| @@ -84,5 +84,6 @@ return { | ||||
|           }, | ||||
|         }, | ||||
|       } | ||||
|     end, 0) | ||||
|   end, | ||||
| } | ||||
|   | ||||
							
								
								
									
										16
									
								
								lua/utils.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								lua/utils.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,16 @@ | ||||
| local M = {} | ||||
|  | ||||
| M.nvim_open_win_border = function(hl_name) | ||||
|   return { | ||||
|     { '┌', hl_name }, | ||||
|     { '─', hl_name }, | ||||
|     { '┐', hl_name }, | ||||
|     { '│', hl_name }, | ||||
|     { '┘', hl_name }, | ||||
|     { '─', hl_name }, | ||||
|     { '└', hl_name }, | ||||
|     { '│', hl_name }, | ||||
|   } | ||||
| end | ||||
|  | ||||
| return M | ||||
		Reference in New Issue
	
	Block a user