mirror of
				https://github.com/halfdan/dotfiles.git
				synced 2025-10-31 12:36:12 +00:00 
			
		
		
		
	Refactor entire conf
This commit is contained in:
		| @@ -1,11 +1,9 @@ | ||||
|  | ||||
| local Remap = require("halfdan.keymap") | ||||
| local nnoremap = Remap.nnoremap | ||||
| local vnoremap = Remap.vnoremap | ||||
| local inoremap = Remap.inoremap | ||||
| local tnoremap = Remap.tnoremap | ||||
| local xnoremap = Remap.xnoremap | ||||
| local nmap = Remap.nmap | ||||
|  | ||||
| -- Yank until end of line | ||||
| nnoremap('Y', 'yg$') | ||||
| @@ -44,13 +42,13 @@ nnoremap("<leader>/", ":split<CR>") | ||||
|  | ||||
| -- Keybindings below this are neovim cli only | ||||
| if vim.g.vscode then | ||||
|   -- Toggle Comment | ||||
|   vim.keymap.set('x', 'gc', '<Plug>VSCodeCommentary', {}) | ||||
|   vim.keymap.set('n', 'gc', '<Plug>VSCodeCommentary', {}) | ||||
|   vim.keymap.set('o', 'gc', '<Plug>VSCodeCommentary', {}) | ||||
|   vim.keymap.set('n', 'gcc', '<Plug>VSCodeCommentaryLine', {}) | ||||
|     -- Toggle Comment | ||||
|     vim.keymap.set('x', 'gc', '<Plug>VSCodeCommentary', {}) | ||||
|     vim.keymap.set('n', 'gc', '<Plug>VSCodeCommentary', {}) | ||||
|     vim.keymap.set('o', 'gc', '<Plug>VSCodeCommentary', {}) | ||||
|     vim.keymap.set('n', 'gcc', '<Plug>VSCodeCommentaryLine', {}) | ||||
|  | ||||
|   return | ||||
|     return | ||||
| end | ||||
|  | ||||
| tnoremap('<ESC>', '<C-\\><C-n>') | ||||
| @@ -108,32 +106,49 @@ nnoremap('<leader>sv', ':source $MYVIMRC<CR>') | ||||
| local builtin = require("telescope.builtin") | ||||
|  | ||||
| nnoremap("<leader>gg", function() | ||||
|   -- builtin.live_grep() | ||||
|   require "telescope".extensions.egrepify.egrepify { sorting_strategy = 'ascending' } | ||||
|     require "telescope".extensions.egrepify.egrepify { sorting_strategy = 'ascending' } | ||||
| end) | ||||
|  | ||||
| nnoremap("<leader>gs", function() | ||||
|     require('neogit').open({ kind = 'split' }) | ||||
| end) | ||||
|  | ||||
| nnoremap("<C-p>", function() | ||||
|   builtin.find_files() | ||||
|     builtin.find_files() | ||||
| end) | ||||
|  | ||||
| nnoremap("<Leader>ff", function() | ||||
|   require('telescope').extensions.smart_open.smart_open({cwd_only = true}) | ||||
|     require('telescope').extensions.smart_open.smart_open({ cwd_only = true }) | ||||
| end) | ||||
|  | ||||
| nnoremap("<Leader>fh", function() | ||||
|   builtin.find_files{cwd=vim.fn.expand('%:p:h')} | ||||
|     builtin.find_files { cwd = vim.fn.expand('%:p:h') } | ||||
| end) | ||||
|  | ||||
| nnoremap("<leader>gw", function() | ||||
|   builtin.grep_string { search = vim.fn.expand("<cword>") } | ||||
|     builtin.grep_string { search = vim.fn.expand("<cword>") } | ||||
| end) | ||||
|  | ||||
| nnoremap("<leader>fb", function() | ||||
|   builtin.buffers() | ||||
|     builtin.buffers() | ||||
| end) | ||||
|  | ||||
| nnoremap("<leader>gc", function() | ||||
|   builtin.git_branches() | ||||
|     builtin.git_branches() | ||||
| end) | ||||
|  | ||||
| nnoremap("<leader>nt", function() | ||||
|     require("neotest").run.run() | ||||
| end) | ||||
|  | ||||
| nnoremap("<leader>nf", function() | ||||
|     require("neotest").run.run(vim.fn.expand("%")) | ||||
| end) | ||||
|  | ||||
| nnoremap("<leader>nd", function() | ||||
|     require("neotest").run.run({ strategy = "dap" }) | ||||
| end) | ||||
|  | ||||
| nnoremap("<leader>ns", function() | ||||
|     require("neotest").summary.toggle() | ||||
| end) | ||||
|   | ||||
| @@ -1,70 +1,68 @@ | ||||
| if vim.g.vscode then | ||||
|   return | ||||
|     return | ||||
| end | ||||
|  | ||||
|  | ||||
|  | ||||
| vim.diagnostic.config({ | ||||
|   underline = true, | ||||
|   signs = { | ||||
|     text = { | ||||
|       [vim.diagnostic.severity.ERROR] = "", | ||||
|       [vim.diagnostic.severity.WARN]  = "", | ||||
|       [vim.diagnostic.severity.INFO]  = "", | ||||
|       [vim.diagnostic.severity.HINT]  = "", -- optional, you can pick any icon | ||||
|     underline = true, | ||||
|     signs = { | ||||
|         text = { | ||||
|             [vim.diagnostic.severity.ERROR] = "", | ||||
|             [vim.diagnostic.severity.WARN]  = "", | ||||
|             [vim.diagnostic.severity.INFO]  = "", | ||||
|             [vim.diagnostic.severity.HINT]  = "", -- optional, you can pick any icon | ||||
|         }, | ||||
|     }, | ||||
|   }, | ||||
|   virtual_text = true, -- or { prefix = "●" } for customization | ||||
|   update_in_insert = false, | ||||
|   severity_sort = true, | ||||
|     virtual_text = true, -- or { prefix = "●" } for customization | ||||
|     update_in_insert = false, | ||||
|     severity_sort = true, | ||||
| }) | ||||
|  | ||||
| -- Setup for nvim-notify | ||||
| vim.lsp.set_log_level(2) | ||||
| -- Map LSP message types (1=Error, 2=Warning, 3=Info, 4=Log) to vim.log.levels | ||||
| local severity_map = { | ||||
|   [1] = vim.log.levels.ERROR, | ||||
|   [2] = vim.log.levels.WARN, | ||||
|   [3] = vim.log.levels.INFO, | ||||
|   [4] = vim.log.levels.DEBUG, | ||||
|     [1] = vim.log.levels.ERROR, | ||||
|     [2] = vim.log.levels.WARN, | ||||
|     [3] = vim.log.levels.INFO, | ||||
|     [4] = vim.log.levels.DEBUG, | ||||
| } | ||||
|  | ||||
| vim.lsp.handlers["window/showMessage"] = function(_, result, ctx, _) | ||||
|   local lvl = severity_map[result.type] or vim.log.levels.INFO | ||||
|   if vim.lsp.log.should_log(lvl) then | ||||
|     local client = vim.lsp.get_client_by_id(ctx.client_id) | ||||
|     local title = client and ("LSP | " .. client.name) or "LSP" | ||||
|     vim.notify(result.message, lvl, { title = title }) | ||||
|   end | ||||
|     local lvl = severity_map[result.type] or vim.log.levels.INFO | ||||
|     if vim.lsp.log.should_log(lvl) then | ||||
|         local client = vim.lsp.get_client_by_id(ctx.client_id) | ||||
|         local title = client and ("LSP | " .. client.name) or "LSP" | ||||
|         vim.notify(result.message, lvl, { title = title }) | ||||
|     end | ||||
| end | ||||
|  | ||||
| -- symbols for autocomplete | ||||
| vim.lsp.protocol.CompletionItemKind = { | ||||
|   "   (Text) ", | ||||
|   "   (Method)", | ||||
|   "   (Function)", | ||||
|   "   (Constructor)", | ||||
|   " ﴲ  (Field)", | ||||
|   "[] (Variable)", | ||||
|   "   (Class)", | ||||
|   " ﰮ  (Interface)", | ||||
|   "   (Module)", | ||||
|   " 襁 (Property)", | ||||
|   "   (Unit)", | ||||
|   "   (Value)", | ||||
|   " 練 (Enum)", | ||||
|   "   (Keyword)", | ||||
|   "   (Snippet)", | ||||
|   "   (Color)", | ||||
|   "   (File)", | ||||
|   "   (Reference)", | ||||
|   "   (Folder)", | ||||
|   "   (EnumMember)", | ||||
|   " ﲀ  (Constant)", | ||||
|   " ﳤ  (Struct)", | ||||
|   "   (Event)", | ||||
|   "   (Operator)", | ||||
|   "   (TypeParameter)" | ||||
|     "   (Text) ", | ||||
|     "   (Method)", | ||||
|     "   (Function)", | ||||
|     "   (Constructor)", | ||||
|     " ﴲ  (Field)", | ||||
|     "[] (Variable)", | ||||
|     "   (Class)", | ||||
|     " ﰮ  (Interface)", | ||||
|     "   (Module)", | ||||
|     " 襁 (Property)", | ||||
|     "   (Unit)", | ||||
|     "   (Value)", | ||||
|     " 練 (Enum)", | ||||
|     "   (Keyword)", | ||||
|     "   (Snippet)", | ||||
|     "   (Color)", | ||||
|     "   (File)", | ||||
|     "   (Reference)", | ||||
|     "   (Folder)", | ||||
|     "   (EnumMember)", | ||||
|     " ﲀ  (Constant)", | ||||
|     " ﳤ  (Struct)", | ||||
|     "   (Event)", | ||||
|     "   (Operator)", | ||||
|     "   (TypeParameter)" | ||||
| } | ||||
|  | ||||
|  | ||||
| @@ -74,73 +72,73 @@ vim.keymap.set('n', '<leader>e', '<cmd>Lspsaga show_line_diagnostics<CR>', { nor | ||||
|  | ||||
| -- Send diagnostics to location list | ||||
| vim.keymap.set('n', '<leader>q', function() | ||||
|   vim.diagnostic.setloclist() | ||||
|     vim.diagnostic.setloclist() | ||||
| end, { noremap = true, silent = true }) | ||||
|  | ||||
| -- Global mappings. | ||||
| -- See `:help vim.diagnostic.*` for documentation on any of the below functions | ||||
| vim.keymap.set('n', '<space>e', vim.diagnostic.open_float) | ||||
| vim.keymap.set('n', ']d', function() | ||||
|   vim.diagnostic.jump_next() | ||||
|     vim.diagnostic.goto_next() | ||||
| end, { desc = "Go to next diagnostic" }) | ||||
|  | ||||
| vim.keymap.set('n', '[d', function() | ||||
|   vim.diagnostic.jump_prev() | ||||
|     vim.diagnostic.goto_prev() | ||||
| end, { desc = "Go to previous diagnostic" }) | ||||
| vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist) | ||||
|  | ||||
| -- Use LspAttach autocommand to only map the following keys | ||||
| -- after the language server attaches to the current buffer | ||||
| vim.api.nvim_create_autocmd('LspAttach', { | ||||
|   group = vim.api.nvim_create_augroup('UserLspConfig', {}), | ||||
|   callback = function(ev) | ||||
|     -- Enable completion triggered by <c-x><c-o> | ||||
|     vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc' | ||||
|     group = vim.api.nvim_create_augroup('UserLspConfig', {}), | ||||
|     callback = function(ev) | ||||
|         -- Enable completion triggered by <c-x><c-o> | ||||
|         vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc' | ||||
|  | ||||
|     -- Buffer local mappings. | ||||
|     -- See `:help vim.lsp.*` for documentation on any of the below functions | ||||
|     local opts = { buffer = ev.buf } | ||||
|     vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts) | ||||
|     vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts) | ||||
|     vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts) | ||||
|     vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts) | ||||
|     vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts) | ||||
|     vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, opts) | ||||
|     vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, opts) | ||||
|     vim.keymap.set('n', '<space>wl', function() | ||||
|       print(vim.inspect(vim.lsp.buf.list_workspace_folders())) | ||||
|     end, opts) | ||||
|     vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, opts) | ||||
|     vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, opts) | ||||
|     vim.keymap.set({ 'n', 'v' }, '<space>ca', vim.lsp.buf.code_action, opts) | ||||
|     vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts) | ||||
|     vim.keymap.set('n', '<space>f', function() | ||||
|       vim.lsp.buf.format { async = true } | ||||
|     end, opts) | ||||
|   end, | ||||
|         -- Buffer local mappings. | ||||
|         -- See `:help vim.lsp.*` for documentation on any of the below functions | ||||
|         local opts = { buffer = ev.buf } | ||||
|         vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts) | ||||
|         vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts) | ||||
|         vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts) | ||||
|         vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts) | ||||
|         vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts) | ||||
|         vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, opts) | ||||
|         vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, opts) | ||||
|         vim.keymap.set('n', '<space>wl', function() | ||||
|             print(vim.inspect(vim.lsp.buf.list_workspace_folders())) | ||||
|         end, opts) | ||||
|         vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, opts) | ||||
|         vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, opts) | ||||
|         vim.keymap.set({ 'n', 'v' }, '<space>ca', vim.lsp.buf.code_action, opts) | ||||
|         vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts) | ||||
|         vim.keymap.set('n', '<space>f', function() | ||||
|             vim.lsp.buf.format { async = true } | ||||
|         end, opts) | ||||
|     end, | ||||
| }) | ||||
|  | ||||
| vim.lsp.config("lua_ls", { | ||||
|   settings = { | ||||
|     Lua = { | ||||
|       runtime = { | ||||
|         -- Tell the language server which version of Lua you're using | ||||
|         version = "LuaJIT", | ||||
|       }, | ||||
|       diagnostics = { | ||||
|         -- Get the language server to recognize the `vim` global | ||||
|         globals = { "vim" }, | ||||
|       }, | ||||
|       workspace = { | ||||
|         -- Make the server aware of Neovim runtime files | ||||
|         library = vim.api.nvim_get_runtime_file("", true), | ||||
|       }, | ||||
|       telemetry = { | ||||
|         -- Do not send telemetry data containing a randomized but unique identifier | ||||
|         enable = false, | ||||
|       }, | ||||
|     settings = { | ||||
|         Lua = { | ||||
|             runtime = { | ||||
|                 -- Tell the language server which version of Lua you're using | ||||
|                 version = "LuaJIT", | ||||
|             }, | ||||
|             diagnostics = { | ||||
|                 -- Get the language server to recognize the `vim` global | ||||
|                 globals = { "vim" }, | ||||
|             }, | ||||
|             workspace = { | ||||
|                 -- Make the server aware of Neovim runtime files | ||||
|                 library = vim.api.nvim_get_runtime_file("", true), | ||||
|             }, | ||||
|             telemetry = { | ||||
|                 -- Do not send telemetry data containing a randomized but unique identifier | ||||
|                 enable = false, | ||||
|             }, | ||||
|         }, | ||||
|     }, | ||||
|   }, | ||||
| }) | ||||
|  | ||||
|  | ||||
| @@ -151,41 +149,41 @@ local neodev = require("neodev") | ||||
| neodev.setup({}) | ||||
|  | ||||
| vim.lsp.config("lua_ls", { | ||||
|   settings = { | ||||
|     Lua = { | ||||
|       runtime = { version = "LuaJIT" }, | ||||
|       diagnostics = { globals = { "vim" } }, | ||||
|       workspace = { | ||||
|         library = vim.api.nvim_get_runtime_file("", true), | ||||
|         checkThirdParty = false, | ||||
|       }, | ||||
|       telemetry = { enable = false }, | ||||
|     settings = { | ||||
|         Lua = { | ||||
|             runtime = { version = "LuaJIT" }, | ||||
|             diagnostics = { globals = { "vim" } }, | ||||
|             workspace = { | ||||
|                 library = vim.api.nvim_get_runtime_file("", true), | ||||
|                 checkThirdParty = false, | ||||
|             }, | ||||
|             telemetry = { enable = false }, | ||||
|         }, | ||||
|     }, | ||||
|   }, | ||||
| }) | ||||
|  | ||||
| vim.lsp.config('gopls', { | ||||
|   cmd = { "gopls" }, | ||||
|   filetypes = { "go", "gomod", "gowork", "gotmpl" }, | ||||
|   root_markers = { "go.work", "go.mod", ".git" }, | ||||
|   settings = { | ||||
|     gopls = { | ||||
|       analyses = { | ||||
|         unusedparams = true, | ||||
|         shadow = true, | ||||
|       }, | ||||
|       staticcheck = true, | ||||
|     cmd = { "gopls" }, | ||||
|     filetypes = { "go", "gomod", "gowork", "gotmpl" }, | ||||
|     root_markers = { "go.work", "go.mod", ".git" }, | ||||
|     settings = { | ||||
|         gopls = { | ||||
|             analyses = { | ||||
|                 unusedparams = true, | ||||
|                 shadow = true, | ||||
|             }, | ||||
|             staticcheck = true, | ||||
|         }, | ||||
|     }, | ||||
|   }, | ||||
| }) | ||||
|  | ||||
| vim.lsp.enable 'lua_ls' | ||||
| vim.lsp.enable 'gopls' | ||||
|  | ||||
| vim.lsp.config('expert', { | ||||
|   cmd = { 'expert' }, | ||||
|   root_markers = { 'mix.exs', '.git' }, | ||||
|   filetypes = { 'elixir', 'eelixir', 'heex' }, | ||||
|     cmd = { 'expert' }, | ||||
|     root_markers = { 'mix.exs', '.git' }, | ||||
|     filetypes = { 'elixir', 'eelixir', 'heex' }, | ||||
| }) | ||||
|  | ||||
| vim.lsp.enable 'expert' | ||||
|   | ||||
| @@ -16,18 +16,7 @@ vim.diagnostic.config({ | ||||
|   }, | ||||
| }, neotest_ns) | ||||
|  | ||||
| neotest.setup({ | ||||
|   log_level = vim.log.levels.DEBUG, | ||||
|   adapters = { | ||||
|     require("neotest-elixir")({ | ||||
|       args = { "--trace" }, | ||||
|       write_delay = 0, | ||||
|     }), | ||||
|     require("neotest-rust"), | ||||
|     --    require("neotest-vim-test")({ allow_file_types = { "haskell"} }), | ||||
|     require("neotest-golang") | ||||
|   }, | ||||
| }) | ||||
|  | ||||
|  | ||||
| nnoremap("<leader>nt", function() | ||||
|   neotest.run.run() | ||||
|   | ||||
| @@ -1,9 +0,0 @@ | ||||
| if vim.g.vscode then | ||||
|   return | ||||
| end | ||||
|  | ||||
| require('notify').setup({ | ||||
|   background_colour = "#000000", | ||||
|   max_width = 120, | ||||
|   max_height = 10, | ||||
| }) | ||||
| @@ -1,12 +0,0 @@ | ||||
| if vim.g.vscode then | ||||
|   return | ||||
| end | ||||
|  | ||||
| -- Sneak | ||||
| vim.g["sneak#label"] = 1 | ||||
| vim.g["sneak#prompt"] = "🔎" | ||||
| vim.g["sneak#s_next"] = 1 | ||||
|  | ||||
| -- Vim-Test | ||||
| vim.g["test#strategy"] = "neovim" | ||||
| vim.g["test#neovim#term_position"] = "vert rightbelow 80" | ||||
| @@ -1,10 +1,11 @@ | ||||
| local vim = vim | ||||
| local api = vim.api | ||||
|  | ||||
| vim.cmd([[autocmd TermOpen * setlocal nonumber norelativenumber]]) | ||||
|  | ||||
| local format_group = api.nvim_create_augroup("FormatGroup", { clear = true }) | ||||
| api.nvim_create_autocmd( | ||||
| 	{ "BufWinEnter", "BufReadPost" }, | ||||
| 	{ pattern = "*", command = "normal zR", group = format_group } | ||||
| ) | ||||
| vim.api.nvim_create_autocmd("FileType", { | ||||
|     pattern = { "norg", "neorg" }, | ||||
|     callback = function() | ||||
|         if pcall(vim.treesitter.start) then | ||||
|             vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()" | ||||
|             vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" | ||||
|         end | ||||
|     end, | ||||
| }) | ||||
|   | ||||
| @@ -1,96 +0,0 @@ | ||||
| local cmp = require'cmp' | ||||
| local lspkind = require('lspkind') | ||||
|  | ||||
| local source_mapping = { | ||||
|   buffer = "[Buffer]", | ||||
|   nvim_lsp = "[LSP]", | ||||
|   nvim_lua = "[Lua]", | ||||
|   path = "[Path]", | ||||
| } | ||||
|  | ||||
| local has_words_before = function() | ||||
|   local line, col = unpack(vim.api.nvim_win_get_cursor(0)) | ||||
|   return col ~= 0 and | ||||
|     vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub( | ||||
|       col, col):match("%s") == nil | ||||
| end | ||||
|  | ||||
| cmp.setup({ | ||||
|   preselect = cmp.PreselectMode.None, | ||||
|   snippet = { | ||||
|     expand = function(args) | ||||
|       vim.snippet.expand(args.body) | ||||
|     end, | ||||
|   }, | ||||
|   mapping = { | ||||
|     ["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), | ||||
|     ["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), | ||||
|     ["<C-d>"] = cmp.mapping.scroll_docs(-4), | ||||
|     ["<C-f>"] = cmp.mapping.scroll_docs(4), | ||||
|     ["<C-Space>"] = cmp.mapping.complete(), | ||||
|     ["<C-e>"] = cmp.mapping.close(), | ||||
|     ["<CR>"] = cmp.mapping.confirm { | ||||
|       behavior = cmp.ConfirmBehavior.Replace, | ||||
|       select = false, -- only confirm if explicitly selected | ||||
|     }, | ||||
|  | ||||
|     ["<Tab>"] = cmp.mapping(function(fallback) | ||||
|       if cmp.visible() then | ||||
|         cmp.select_next_item() | ||||
|       elseif vim.snippet.active({ direction = 1 }) then | ||||
|         vim.snippet.jump(1) | ||||
|       elseif has_words_before() then | ||||
|         cmp.complete() | ||||
|       else | ||||
|         fallback() | ||||
|       end | ||||
|     end, { "i", "s" }), | ||||
|  | ||||
|     ["<S-Tab>"] = cmp.mapping(function(fallback) | ||||
|       if cmp.visible() then | ||||
|         cmp.select_prev_item() | ||||
|       elseif vim.snippet.active({ direction = -1 }) then | ||||
|         vim.snippet.jump(-1) | ||||
|       else | ||||
|         fallback() | ||||
|       end | ||||
|     end, { "i", "s" }), | ||||
|   }, | ||||
|  | ||||
|   sources = cmp.config.sources({ | ||||
|     { name = "nvim_lsp" }, | ||||
|   }, { | ||||
|     { name = "buffer" }, | ||||
|   }), | ||||
|  | ||||
|   formatting = { | ||||
|     format = function(entry, vim_item) | ||||
|       vim_item.kind = lspkind.presets.default[vim_item.kind] | ||||
|       local menu = source_mapping[entry.source.name] | ||||
|       vim_item.menu = menu | ||||
|       return vim_item | ||||
|     end, | ||||
|   }, | ||||
|  | ||||
|   experimental = { | ||||
|     ghost_text = true, | ||||
|   }, | ||||
| }) | ||||
|  | ||||
| -- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore). | ||||
| cmp.setup.cmdline({ '/', '?' }, { | ||||
|   sources = { | ||||
|     { name = 'buffer' } | ||||
|   } | ||||
| }) | ||||
|  | ||||
| -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). | ||||
| cmp.setup.cmdline(':', { | ||||
|   sources = cmp.config.sources({ | ||||
|     { name = 'path' } | ||||
|   }, { | ||||
|       { name = 'cmdline' } | ||||
|     }), | ||||
|   mappings = cmp.mapping.preset.cmdline(), | ||||
| }) | ||||
|  | ||||
| @@ -1,4 +1,3 @@ | ||||
| local dap = require("dap") | ||||
| local dapui = require("dapui") | ||||
| local daptext = require("nvim-dap-virtual-text") | ||||
|  | ||||
| @@ -81,37 +80,37 @@ end | ||||
|  | ||||
|  | ||||
| dap.adapters.mix_task = { | ||||
|   type = 'executable', | ||||
|   command = '/usr/local/opt/elixir-ls/rel/debugger.sh', -- debugger.bat for windows | ||||
|   args = {} | ||||
|     type = 'executable', | ||||
|     command = '/usr/local/opt/elixir-ls/rel/debugger.sh', -- debugger.bat for windows | ||||
|     args = {} | ||||
| } | ||||
|  | ||||
| dapgo.setup() | ||||
|  | ||||
| dap.configurations.elixir = { | ||||
|   { | ||||
|     type = 'mix_task', | ||||
|     name = 'mix test', | ||||
|     request = 'launch', | ||||
|     task = 'test', | ||||
|     taskArgs = { '--trace' }, | ||||
|     startApps = false, | ||||
|     projectDir = "${workspaceFolder}", | ||||
|     requireFiles = { "test/**/test_helper.exs", "test/**/*_test.exs" } | ||||
|   }, | ||||
|   { | ||||
|     name = "mix test focused", | ||||
|     type = "mix_task", | ||||
|     request = "launch", | ||||
|     taskArgs = { | ||||
|       "${relativeFile}:${lineNumber}", | ||||
|       "--color", | ||||
|       "--trace" | ||||
|     { | ||||
|         type = 'mix_task', | ||||
|         name = 'mix test', | ||||
|         request = 'launch', | ||||
|         task = 'test', | ||||
|         taskArgs = { '--trace' }, | ||||
|         startApps = false, | ||||
|         projectDir = "${workspaceFolder}", | ||||
|         requireFiles = { "test/**/test_helper.exs", "test/**/*_test.exs" } | ||||
|     }, | ||||
|     projectDir = "${workspaceRoot}", | ||||
|     requireFiles = { | ||||
|       "test/**/test_helper.exs", | ||||
|       "test/**/*_test.exs" | ||||
|     { | ||||
|         name = "mix test focused", | ||||
|         type = "mix_task", | ||||
|         request = "launch", | ||||
|         taskArgs = { | ||||
|             "${relativeFile}:${lineNumber}", | ||||
|             "--color", | ||||
|             "--trace" | ||||
|         }, | ||||
|         projectDir = "${workspaceRoot}", | ||||
|         requireFiles = { | ||||
|             "test/**/test_helper.exs", | ||||
|             "test/**/*_test.exs" | ||||
|         } | ||||
|     } | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -1,25 +0,0 @@ | ||||
| O = { | ||||
|   auto_close_tree = 0, | ||||
|   auto_complete = true, | ||||
|   background = 'dark', | ||||
|   ignorecase = 'smartcase', | ||||
|   clipboard = 'unnamedplus', | ||||
|   incsearch = true, | ||||
|   termguicolors = true, | ||||
|   colorscheme = 'monokai-pro', | ||||
|   hidden_files = true, | ||||
|   wrap_lines = false, | ||||
|   number = true, | ||||
|   relative_number = true, | ||||
|   shell = 'zsh', | ||||
|   timeoutlen = 500, | ||||
|   scrolloff = 8, | ||||
|   noshowmode = true, | ||||
|   splitright = true, | ||||
|   splitbelow = true, | ||||
|  | ||||
|   database = {save_location = '~/.config/nvcode_db', auto_execute = 1}, | ||||
| } | ||||
|  | ||||
| DATA_PATH = vim.fn.stdpath('data') | ||||
| CACHE_PATH = vim.fn.stdpath('cache') | ||||
| @@ -4,19 +4,13 @@ if vim.g.vscode then | ||||
|     -- VSCode extension | ||||
| else | ||||
|     -- ordinary Neovim | ||||
|   require("halfdan.lazy") | ||||
|   vim.notify = require("notify") | ||||
|     require("halfdan.lazy") | ||||
|  | ||||
|   require("halfdan.neogit") | ||||
|   -- require('halfdan.globals') | ||||
|   require('halfdan.keymap') | ||||
|   -- require('halfdan.cmp') | ||||
|   require('halfdan.colorscheme') | ||||
|   require('halfdan.treesitter') | ||||
|   require('halfdan.telescope') | ||||
|   require('halfdan.lualine') | ||||
|     require('halfdan.keymap') | ||||
|     require('halfdan.colorscheme') | ||||
|     require('halfdan.lualine') | ||||
|  | ||||
|   require('halfdan.autocmds') | ||||
|     require('halfdan.autocmds') | ||||
|  | ||||
|   require('halfdan.debugger') | ||||
|     require('halfdan.debugger') | ||||
| end | ||||
|   | ||||
| @@ -1,376 +1,24 @@ | ||||
| if vim.g.vscode then | ||||
|     return | ||||
| end | ||||
|  | ||||
| local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" | ||||
| if not vim.loop.fs_stat(lazypath) then | ||||
|   vim.fn.system({ | ||||
|     "git", | ||||
|     "clone", | ||||
|     "--filter=blob:none", | ||||
|     "https://github.com/folke/lazy.nvim.git", | ||||
|     "--branch=stable", -- latest stable release | ||||
|     lazypath, | ||||
|   }) | ||||
|     vim.fn.system({ | ||||
|         "git", | ||||
|         "clone", | ||||
|         "--filter=blob:none", | ||||
|         "https://github.com/folke/lazy.nvim.git", | ||||
|         "--branch=stable", -- latest stable release | ||||
|         lazypath, | ||||
|     }) | ||||
| end | ||||
| vim.opt.rtp:prepend(lazypath) | ||||
|  | ||||
| if vim.g.vscode then | ||||
|   return | ||||
| end | ||||
|  | ||||
| require("lazy").setup({ | ||||
|   { | ||||
|     "NeogitOrg/neogit", | ||||
|     dependencies = { | ||||
|       "nvim-lua/plenary.nvim",         -- required | ||||
|       "nvim-telescope/telescope.nvim", -- optional | ||||
|       "sindrets/diffview.nvim",        -- optional | ||||
|       "ibhagwan/fzf-lua",              -- optional | ||||
|     spec = { | ||||
|         -- import your plugins | ||||
|         { import = "halfdan.plugins" }, | ||||
|     }, | ||||
|     config = true | ||||
|   }, | ||||
|   {'airblade/vim-gitgutter'}, | ||||
|  | ||||
|   -- Load .editorconfig files | ||||
|   {'editorconfig/editorconfig-vim'}, | ||||
|  | ||||
|   { | ||||
|     "m4xshen/hardtime.nvim", | ||||
|     lazy = false, | ||||
|     dependencies = { "MunifTanjim/nui.nvim" }, | ||||
|     opts = {}, | ||||
|   }, | ||||
|   { | ||||
|     "karb94/neoscroll.nvim", | ||||
|     opts = {}, | ||||
|   }, | ||||
|   {'junegunn/vim-easy-align'}, | ||||
|  | ||||
|   -- Goodies | ||||
|   {'tpope/vim-fugitive'}, | ||||
|   {'tpope/vim-surround'}, -- ✅ | ||||
|   {'tpope/vim-dispatch'}, | ||||
|  | ||||
|   -- Treesitter | ||||
|   { | ||||
|     'nvim-treesitter/nvim-treesitter', | ||||
|     branch = 'main', | ||||
|     build = ':TSUpdate', | ||||
|   }, | ||||
|  | ||||
|   -- Testing | ||||
|   {'vim-test/vim-test'}, | ||||
|   { | ||||
|     "nvim-neotest/neotest", | ||||
|     dependencies = { | ||||
|       "nvim-neotest/nvim-nio", | ||||
|       "nvim-lua/plenary.nvim", | ||||
|       "nvim-treesitter/nvim-treesitter", | ||||
|       "antoinemadec/FixCursorHold.nvim", | ||||
|       -- plugins | ||||
|       "fredrikaverpil/neotest-golang", | ||||
|       "jfpedroza/neotest-elixir", | ||||
|       "rouge8/neotest-rust", | ||||
|     } | ||||
|   }, | ||||
|   {"nvim-neotest/neotest-vim-test" }, | ||||
|   {'akinsho/toggleterm.nvim', version = "*", config = function() | ||||
|     require('toggleterm').setup({ | ||||
|       open_mapping = [[<C-\>]], | ||||
|       start_in_insert = true, | ||||
|       direction = "horizontal", | ||||
|       autochdir = false, | ||||
|       size = 20, | ||||
|       highlights = { | ||||
|         FloatBorder = { link = "ToggleTermBorder" }, | ||||
|         Normal = { link = "ToggleTerm" }, | ||||
|         NormalFloat = { link = "ToggleTerm" }, | ||||
|       }, | ||||
|       winbar = { | ||||
|         enabled = true, | ||||
|         name_formatter = function(term) | ||||
|           return term.name | ||||
|         end, | ||||
|       }, | ||||
|     }) | ||||
|   end}, | ||||
|  | ||||
|   {'f-person/git-blame.nvim'}, | ||||
|   -- Status Line and Bufferline | ||||
|   { | ||||
|     'nvim-lualine/lualine.nvim', | ||||
|     dependencies = {'kyazdani42/nvim-web-devicons'}, | ||||
|     event = { "BufReadPost", "BufNewFile" }, | ||||
|     opts = function() | ||||
|       local monokai_opts = require("halfdan.util").opts("monokai-pro.nvim") | ||||
|       return { | ||||
|         float = vim.tbl_contains(monokai_opts.background_clear or {}, "neo-tree"), | ||||
|         separator = "bubble", -- bubble | triangle | ||||
|         ---@type any | ||||
|         colorful = true, | ||||
|       } | ||||
|     end, | ||||
|     config = function(_, opts) | ||||
|       local lualine_config = require("halfdan.lualine") | ||||
|       lualine_config.setup(opts) | ||||
|       lualine_config.load() | ||||
|     end, | ||||
|   }, | ||||
|  | ||||
|   {'rcarriga/nvim-notify'}, | ||||
|  | ||||
|   { | ||||
|     "nvim-neorg/neorg", | ||||
|     lazy = false, -- Disable lazy loading as some `lazy.nvim` distributions set `lazy = true` by default | ||||
|     version = "*", -- Pin Neorg to the latest stable release | ||||
|     config = function() | ||||
|       require('neorg').setup({ | ||||
|         load = { | ||||
|           ["core.defaults"] = {}, | ||||
|           ["core.dirman"] = { | ||||
|             config = { | ||||
|               workspaces = { | ||||
|                 work = "~/org/work", | ||||
|                 home = "~/org/home", | ||||
|               }, | ||||
|               index = "index.norg", | ||||
|             } | ||||
|           }, | ||||
|           -- ["core.completion"] = { | ||||
|           --   config = { | ||||
|           --     engine = "nvim-cmp", | ||||
|           --   }, | ||||
|           -- }, | ||||
|           ["core.concealer"] = {}, | ||||
|           ["core.journal"] = { | ||||
|             config = { | ||||
|               strategy = "flat", | ||||
|             }, | ||||
|           }, | ||||
|           ["core.integrations.telescope"] = {}, | ||||
|         } | ||||
|       }) | ||||
|     end, | ||||
|   }, | ||||
|   {'nvim-neorg/neorg-telescope'}, | ||||
|  | ||||
|   {'justinmk/vim-sneak'}, | ||||
|  | ||||
|   {'machakann/vim-highlightedyank'}, | ||||
|  | ||||
|   { | ||||
|     'nvimdev/lspsaga.nvim', | ||||
|     config = function() | ||||
|       require('lspsaga').setup({ | ||||
|         symbol_in_winbar = { | ||||
|           enable = false, | ||||
|         }, | ||||
|         lightbulb = { | ||||
|           enable = false, | ||||
|         } | ||||
|       }) | ||||
|     end, | ||||
|     dependencies = { | ||||
|       'nvim-treesitter/nvim-treesitter', -- optional | ||||
|       'nvim-tree/nvim-web-devicons'     -- optional | ||||
|     } | ||||
|   }, | ||||
|  | ||||
|   -- { | ||||
|   --   'hrsh7th/nvim-cmp', | ||||
|   --   dependencies = { | ||||
|   --     { 'hrsh7th/cmp-buffer', after = 'nvim-cmp' }, | ||||
|   --     'hrsh7th/cmp-nvim-lsp', | ||||
|   --     'onsails/lspkind.nvim', | ||||
|   --     { 'hrsh7th/cmp-path', after = 'nvim-cmp' }, | ||||
|   --     { 'hrsh7th/cmp-nvim-lua', after = 'nvim-cmp' }, | ||||
|   --     { 'hrsh7th/cmp-cmdline', after = 'nvim-cmp', event = 'CmdlineEnter' }, | ||||
|   --     {'petertriho/cmp-git', after = 'nvim-cmp'}, | ||||
|   --   } | ||||
|   -- }, | ||||
|   { | ||||
|     'saghen/blink.cmp', | ||||
|     dependencies = { 'rafamadriz/friendly-snippets' }, | ||||
|     version = '1.*', | ||||
|     -- AND/OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust | ||||
|     -- build = 'cargo build --release', | ||||
|     -- If you use nix, you can build from source using latest nightly rust with: | ||||
|     -- build = 'nix run .#build-plugin', | ||||
|  | ||||
|     ---@module 'blink.cmp' | ||||
|     ---@type blink.cmp.Config | ||||
|     opts = { | ||||
|       -- 'default' (recommended) for mappings similar to built-in completions (C-y to accept) | ||||
|       -- 'super-tab' for mappings similar to vscode (tab to accept) | ||||
|       -- 'enter' for enter to accept | ||||
|       -- 'none' for no mappings | ||||
|       -- | ||||
|       -- All presets have the following mappings: | ||||
|       -- C-space: Open menu or open docs if already open | ||||
|       -- C-n/C-p or Up/Down: Select next/previous item | ||||
|       -- C-e: Hide menu | ||||
|       -- C-k: Toggle signature help (if signature.enabled = true) | ||||
|       -- | ||||
|       -- See :h blink-cmp-config-keymap for defining your own keymap | ||||
|       keymap = { preset = 'super-tab' }, | ||||
|  | ||||
|       appearance = { | ||||
|         -- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font' | ||||
|         -- Adjusts spacing to ensure icons are aligned | ||||
|         nerd_font_variant = 'mono' | ||||
|       }, | ||||
|  | ||||
|       -- (Default) Only show the documentation popup when manually triggered | ||||
|       completion = { documentation = { auto_show = false } }, | ||||
|  | ||||
|       -- Default list of enabled providers defined so that you can extend it | ||||
|       -- elsewhere in your config, without redefining it, due to `opts_extend` | ||||
|       sources = { | ||||
|         default = { 'lsp', 'path', 'snippets', 'buffer' }, | ||||
|       }, | ||||
|  | ||||
|       -- (Default) Rust fuzzy matcher for typo resistance and significantly better performance | ||||
|       -- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation, | ||||
|       -- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"` | ||||
|       -- | ||||
|       -- See the fuzzy documentation for more information | ||||
|       fuzzy = { implementation = "prefer_rust" } | ||||
|     }, | ||||
|     opts_extend = { "sources.default" } | ||||
|   }, | ||||
|  | ||||
|   -- Used to display LSP status in Lualine | ||||
|   {'nvim-lua/lsp-status.nvim'}, | ||||
|  | ||||
|   { | ||||
|     "hedyhli/outline.nvim", | ||||
|     lazy = true, | ||||
|     cmd = { "Outline", "OutlineOpen" }, | ||||
|     keys = { -- Example mapping to toggle outline | ||||
|       { "<leader>o", "<cmd>Outline<CR>", desc = "Toggle outline" }, | ||||
|     }, | ||||
|     opts = { | ||||
|       -- Your setup opts here | ||||
|     }, | ||||
|   }, | ||||
|   { | ||||
|     'numToStr/Comment.nvim', | ||||
|     config = function() | ||||
|       require('Comment').setup() | ||||
|     end | ||||
|   }, | ||||
|  | ||||
|   -- Telescope fuzzy find files/grep | ||||
|   {'nvim-lua/popup.nvim'}, | ||||
|   {'nvim-lua/plenary.nvim'}, | ||||
|   { | ||||
|     "fdschmidt93/telescope-egrepify.nvim", | ||||
|     dependencies = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" } | ||||
|   }, | ||||
|   {'nvim-telescope/telescope-fzf-native.nvim', build = 'make' }, | ||||
|   {'nvim-telescope/telescope.nvim'}, | ||||
|   {'nvim-telescope/telescope-dap.nvim'}, | ||||
|   { | ||||
|     "danielfalk/smart-open.nvim", | ||||
|     branch = "0.2.x", | ||||
|     dependencies = {"kkharji/sqlite.lua"} | ||||
|   }, | ||||
|  | ||||
|   {'numToStr/FTerm.nvim'}, | ||||
|  | ||||
|   -- Debugging | ||||
|   "mfussenegger/nvim-dap", | ||||
|   "rcarriga/nvim-dap-ui", | ||||
|   "nvim-neotest/nvim-nio", | ||||
|   "theHamsta/nvim-dap-virtual-text", | ||||
|   "leoluz/nvim-dap-go", | ||||
|  | ||||
|   -- => Language Support | ||||
|   { | ||||
|     "folke/neodev.nvim", | ||||
|     config = function() | ||||
|       require("neodev").setup({}) | ||||
|     end | ||||
|   }, | ||||
|   {'neovim/nvim-lspconfig'}, | ||||
|   {'rust-lang/rust.vim'}, | ||||
|   { | ||||
|     'mrcjkb/rustaceanvim', | ||||
|     version = '^6', -- Recommended | ||||
|     lazy = false, -- This plugin is already lazy | ||||
|   }, | ||||
|   {'tpope/vim-projectionist'}, | ||||
|  | ||||
|   -- themes & colorschemes | ||||
|   { "rose-pine/neovim", name = "rose-pine" }, | ||||
|   {'luisiacc/gruvbox-baby'}, | ||||
|   {'akinsho/bufferline.nvim', version = "*", dependencies = 'nvim-tree/nvim-web-devicons', | ||||
|     keys = { | ||||
|       { "<C-1>", "<Cmd>BufferLineGoToBuffer 1<CR>", desc = "Go to buffer 1" }, | ||||
|       { "<C-2>", "<Cmd>BufferLineGoToBuffer 2<CR>", desc = "Go to buffer 2" }, | ||||
|       { "<C-3>", "<Cmd>BufferLineGoToBuffer 3<CR>", desc = "Go to buffer 3" }, | ||||
|       { "<C-4>", "<Cmd>BufferLineGoToBuffer 4<CR>", desc = "Go to buffer 4" }, | ||||
|       { "<C-5>", "<Cmd>BufferLineGoToBuffer 5<CR>", desc = "Go to buffer 5" }, | ||||
|       { "<C-6>", "<Cmd>BufferLineGoToBuffer 6<CR>", desc = "Go to buffer 6" }, | ||||
|       { "<C-7>", "<Cmd>BufferLineGoToBuffer 7<CR>", desc = "Go to buffer 7" }, | ||||
|       { "<C-8>", "<Cmd>BufferLineGoToBuffer 8<CR>", desc = "Go to buffer 8" }, | ||||
|       { "<C-9>", "<Cmd>BufferLineGoToBuffer 9<CR>", desc = "Go to buffer 9" }, | ||||
|       { "<S-l>", "<Cmd>BufferLineCycleNext<CR>", desc = "Next buffer" }, | ||||
|       { "<S-h>", "<Cmd>BufferLineCyclePrev<CR>", desc = "Previous buffer" }, | ||||
|       { "<A-S-l>", "<Cmd>BufferLineMoveNext<CR>", desc = "Move buffer right" }, | ||||
|       { "<A-S-h>", "<Cmd>BufferLineMovePrev<CR>", desc = "Move buffer left" }, | ||||
|     }, | ||||
|     opts = function() | ||||
|       local monokai_opts = require("halfdan.util").opts("monokai-pro.nvim") | ||||
|       return { | ||||
|         options = { | ||||
|           diagnostics = "nvim_lsp", -- | "nvim_lsp" | "coc", | ||||
|           -- separator_style = "", -- | "thick" | "thin" | "slope" | { 'any', 'any' }, | ||||
|           separator_style = { "", "" }, -- | "thick" | "thin" | { 'any', 'any' }, | ||||
|           -- separator_style = "slant", -- | "thick" | "thin" | { 'any', 'any' }, | ||||
|           indicator = { | ||||
|             -- icon = " ", | ||||
|             -- style = 'icon', | ||||
|             style = "underline", | ||||
|           }, | ||||
|           close_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions" | ||||
|           diagnostics_indicator = function(count, _, _, _) | ||||
|             if count > 9 then | ||||
|               return "9+" | ||||
|             end | ||||
|             return tostring(count) | ||||
|           end, | ||||
|           numbers = function(opts) | ||||
|             return string.format('%s', opts.raise(opts.ordinal)) | ||||
|           end, | ||||
|           offsets = { | ||||
|             { | ||||
|               filetype = "neo-tree", | ||||
|               text = "EXPLORER", | ||||
|               text_align = "center", | ||||
|               separator = vim.tbl_contains(monokai_opts.background_clear or {}, "neo-tree"), -- set to `true` if clear background of neo-tree | ||||
|             }, | ||||
|             { | ||||
|               filetype = "NvimTree", | ||||
|               text = "EXPLORER", | ||||
|               text_align = "center", | ||||
|               separator = vim.tbl_contains(monokai_opts.background_clear or {}, "nvim-tree"), -- set to `true` if clear background of neo-tree | ||||
|             }, | ||||
|           }, | ||||
|           hover = { | ||||
|             enabled = true, | ||||
|             delay = 0, | ||||
|             reveal = { "close" }, | ||||
|           }, | ||||
|         }, | ||||
|       } | ||||
|     end, | ||||
|   }, | ||||
|   { | ||||
|     "nvim-neo-tree/neo-tree.nvim", | ||||
|     branch = "v3.x", | ||||
|     dependencies = { | ||||
|       "nvim-lua/plenary.nvim", | ||||
|       "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended | ||||
|       "MunifTanjim/nui.nvim", | ||||
|       -- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information | ||||
|     } | ||||
|   } | ||||
|     checker = { enabled = true }, | ||||
| }) | ||||
|   | ||||
| @@ -1,12 +0,0 @@ | ||||
| local neogit = require('neogit') | ||||
| local nnoremap = require('halfdan.keymap').nnoremap | ||||
|  | ||||
| neogit.setup { | ||||
|   integrations = { | ||||
|     diffview = true | ||||
|   } | ||||
| } | ||||
|  | ||||
| nnoremap("<leader>gs", function() | ||||
|     neogit.open({kind='split'}) | ||||
| end) | ||||
							
								
								
									
										55
									
								
								.config/nvim/lua/halfdan/plugins/blink.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										55
									
								
								.config/nvim/lua/halfdan/plugins/blink.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,55 @@ | ||||
| return { | ||||
|  | ||||
|  | ||||
|     { | ||||
|         'saghen/blink.cmp', | ||||
|         dependencies = { 'rafamadriz/friendly-snippets' }, | ||||
|         version = '1.*', | ||||
|         -- AND/OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust | ||||
|         -- build = 'cargo build --release', | ||||
|         -- If you use nix, you can build from source using latest nightly rust with: | ||||
|         -- build = 'nix run .#build-plugin', | ||||
|  | ||||
|         ---@module 'blink.cmp' | ||||
|         ---@type blink.cmp.Config | ||||
|         opts = { | ||||
|             -- 'default' (recommended) for mappings similar to built-in completions (C-y to accept) | ||||
|             -- 'super-tab' for mappings similar to vscode (tab to accept) | ||||
|             -- 'enter' for enter to accept | ||||
|             -- 'none' for no mappings | ||||
|             -- | ||||
|             -- All presets have the following mappings: | ||||
|             -- C-space: Open menu or open docs if already open | ||||
|             -- C-n/C-p or Up/Down: Select next/previous item | ||||
|             -- C-e: Hide menu | ||||
|             -- C-k: Toggle signature help (if signature.enabled = true) | ||||
|             -- | ||||
|             -- See :h blink-cmp-config-keymap for defining your own keymap | ||||
|             keymap = { preset = 'super-tab' }, | ||||
|  | ||||
|             appearance = { | ||||
|                 -- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font' | ||||
|                 -- Adjusts spacing to ensure icons are aligned | ||||
|                 nerd_font_variant = 'mono' | ||||
|             }, | ||||
|  | ||||
|             -- (Default) Only show the documentation popup when manually triggered | ||||
|             completion = { documentation = { auto_show = false } }, | ||||
|  | ||||
|             -- Default list of enabled providers defined so that you can extend it | ||||
|             -- elsewhere in your config, without redefining it, due to `opts_extend` | ||||
|             sources = { | ||||
|                 default = { 'lsp', 'path', 'snippets', 'buffer' }, | ||||
|             }, | ||||
|  | ||||
|             -- (Default) Rust fuzzy matcher for typo resistance and significantly better performance | ||||
|             -- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation, | ||||
|             -- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"` | ||||
|             -- | ||||
|             -- See the fuzzy documentation for more information | ||||
|             fuzzy = { implementation = "prefer_rust" } | ||||
|         }, | ||||
|         opts_extend = { "sources.default" } | ||||
|     }, | ||||
|  | ||||
| } | ||||
							
								
								
									
										8
									
								
								.config/nvim/lua/halfdan/plugins/debugging.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								.config/nvim/lua/halfdan/plugins/debugging.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,8 @@ | ||||
| return { | ||||
|     -- Debugging | ||||
|     "mfussenegger/nvim-dap", | ||||
|     "rcarriga/nvim-dap-ui", | ||||
|     "nvim-neotest/nvim-nio", | ||||
|     "theHamsta/nvim-dap-virtual-text", | ||||
|     "leoluz/nvim-dap-go", | ||||
| } | ||||
							
								
								
									
										35
									
								
								.config/nvim/lua/halfdan/plugins/lsp.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								.config/nvim/lua/halfdan/plugins/lsp.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,35 @@ | ||||
| return { | ||||
|     -- => Language Support | ||||
|     { | ||||
|         'nvimdev/lspsaga.nvim', | ||||
|         config = function() | ||||
|             require('lspsaga').setup({ | ||||
|                 symbol_in_winbar = { | ||||
|                     enable = false, | ||||
|                 }, | ||||
|                 lightbulb = { | ||||
|                     enable = false, | ||||
|                 } | ||||
|             }) | ||||
|         end, | ||||
|         dependencies = { | ||||
|             'nvim-treesitter/nvim-treesitter', -- optional | ||||
|             'nvim-tree/nvim-web-devicons'      -- optional | ||||
|         } | ||||
|     }, | ||||
|     { | ||||
|         "folke/neodev.nvim", | ||||
|         config = function() | ||||
|             require("neodev").setup({}) | ||||
|         end | ||||
|     }, | ||||
|     { 'neovim/nvim-lspconfig' }, | ||||
|     { 'rust-lang/rust.vim' }, | ||||
|     { | ||||
|         'mrcjkb/rustaceanvim', | ||||
|         version = '^6', -- Recommended | ||||
|         lazy = false,   -- This plugin is already lazy | ||||
|     }, | ||||
|     -- Used to display LSP status in Lualine | ||||
|     { 'nvim-lua/lsp-status.nvim' }, | ||||
| } | ||||
							
								
								
									
										18
									
								
								.config/nvim/lua/halfdan/plugins/neogit.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								.config/nvim/lua/halfdan/plugins/neogit.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,18 @@ | ||||
| return { | ||||
|     { | ||||
|         "NeogitOrg/neogit", | ||||
|         dependencies = { | ||||
|             "nvim-lua/plenary.nvim",     -- required | ||||
|             "nvim-telescope/telescope.nvim", -- optional | ||||
|             "sindrets/diffview.nvim",    -- optional | ||||
|             "ibhagwan/fzf-lua",          -- optional | ||||
|         }, | ||||
|         config = function() | ||||
|             require("neogit").setup({ | ||||
|                 integrations = { | ||||
|                     diffview = true | ||||
|                 } | ||||
|             }) | ||||
|         end | ||||
|     }, | ||||
| } | ||||
							
								
								
									
										36
									
								
								.config/nvim/lua/halfdan/plugins/neorg.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								.config/nvim/lua/halfdan/plugins/neorg.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,36 @@ | ||||
| return { | ||||
|     { | ||||
|         "nvim-neorg/neorg", | ||||
|         lazy = false, -- Disable lazy loading as some `lazy.nvim` distributions set `lazy = true` by default | ||||
|         version = "*", -- Pin Neorg to the latest stable release | ||||
|         config = function() | ||||
|             require('neorg').setup({ | ||||
|                 load = { | ||||
|                     ["core.defaults"] = {}, | ||||
|                     ["core.dirman"] = { | ||||
|                         config = { | ||||
|                             workspaces = { | ||||
|                                 work = "~/org/work", | ||||
|                                 home = "~/org/home", | ||||
|                             }, | ||||
|                             index = "index.norg", | ||||
|                         } | ||||
|                     }, | ||||
|                     -- ["core.completion"] = { | ||||
|                     --   config = { | ||||
|                     --     engine = "nvim-cmp", | ||||
|                     --   }, | ||||
|                     -- }, | ||||
|                     ["core.concealer"] = {}, | ||||
|                     ["core.journal"] = { | ||||
|                         config = { | ||||
|                             strategy = "flat", | ||||
|                         }, | ||||
|                     }, | ||||
|                     ["core.integrations.telescope"] = {}, | ||||
|                 } | ||||
|             }) | ||||
|         end, | ||||
|     }, | ||||
|     { 'nvim-neorg/neorg-telescope' }, | ||||
| } | ||||
							
								
								
									
										28
									
								
								.config/nvim/lua/halfdan/plugins/neotest.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								.config/nvim/lua/halfdan/plugins/neotest.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,28 @@ | ||||
| return { | ||||
|     -- Testing | ||||
|     { | ||||
|         "nvim-neotest/neotest", | ||||
|         dependencies = { | ||||
|             "nvim-neotest/nvim-nio", | ||||
|             "nvim-lua/plenary.nvim", | ||||
|             "nvim-treesitter/nvim-treesitter", | ||||
|             -- plugins | ||||
|             "fredrikaverpil/neotest-golang", | ||||
|             "jfpedroza/neotest-elixir", | ||||
|             "rouge8/neotest-rust", | ||||
|         }, | ||||
|         config = function() | ||||
|             require("neotest").setup({ | ||||
|                 log_level = vim.log.levels.DEBUG, | ||||
|                 adapters = { | ||||
|                     require("neotest-elixir")({ | ||||
|                         args = { "--trace" }, | ||||
|                         write_delay = 0, | ||||
|                     }), | ||||
|                     require("neotest-rust"), | ||||
|                     require("neotest-golang") | ||||
|                 }, | ||||
|             }) | ||||
|         end | ||||
|     }, | ||||
| } | ||||
							
								
								
									
										105
									
								
								.config/nvim/lua/halfdan/plugins/other.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										105
									
								
								.config/nvim/lua/halfdan/plugins/other.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,105 @@ | ||||
| return { | ||||
|  | ||||
|     { 'airblade/vim-gitgutter' }, | ||||
|  | ||||
|     -- Load .editorconfig files | ||||
|     { 'editorconfig/editorconfig-vim' }, | ||||
|  | ||||
|     { | ||||
|         "m4xshen/hardtime.nvim", | ||||
|         lazy = false, | ||||
|         dependencies = { "MunifTanjim/nui.nvim" }, | ||||
|         opts = {}, | ||||
|     }, | ||||
|     { | ||||
|         "karb94/neoscroll.nvim", | ||||
|         opts = {}, | ||||
|     }, | ||||
|     { 'junegunn/vim-easy-align' }, | ||||
|  | ||||
|     -- Goodies | ||||
|     { 'tpope/vim-fugitive' }, | ||||
|     { 'tpope/vim-surround' }, | ||||
|     { 'tpope/vim-dispatch' }, | ||||
|  | ||||
|     { | ||||
|         'akinsho/toggleterm.nvim', | ||||
|         version = "*", | ||||
|         config = function() | ||||
|             require('toggleterm').setup({ | ||||
|                 open_mapping = [[<C-\>]], | ||||
|                 start_in_insert = true, | ||||
|                 direction = "horizontal", | ||||
|                 autochdir = false, | ||||
|                 size = 20, | ||||
|                 highlights = { | ||||
|                     FloatBorder = { link = "ToggleTermBorder" }, | ||||
|                     Normal = { link = "ToggleTerm" }, | ||||
|                     NormalFloat = { link = "ToggleTerm" }, | ||||
|                 }, | ||||
|                 winbar = { | ||||
|                     enabled = true, | ||||
|                     name_formatter = function(term) | ||||
|                         return term.name | ||||
|                     end, | ||||
|                 }, | ||||
|             }) | ||||
|         end | ||||
|     }, | ||||
|  | ||||
|     { 'f-person/git-blame.nvim' }, | ||||
|     { | ||||
|         'justinmk/vim-sneak', | ||||
|         config = function() | ||||
|             vim.g["sneak#label"] = 1 | ||||
|             vim.g["sneak#prompt"] = "🔎" | ||||
|             vim.g["sneak#s_next"] = 1 | ||||
|  | ||||
|             -- Vim-Test | ||||
|             vim.g["test#strategy"] = "neovim" | ||||
|             vim.g["test#neovim#term_position"] = "vert rightbelow 80" | ||||
|         end | ||||
|     }, | ||||
|  | ||||
|     { 'machakann/vim-highlightedyank' }, | ||||
|  | ||||
|  | ||||
|  | ||||
|     { | ||||
|         "hedyhli/outline.nvim", | ||||
|         lazy = true, | ||||
|         cmd = { "Outline", "OutlineOpen" }, | ||||
|         keys = { -- Example mapping to toggle outline | ||||
|             { "<leader>o", "<cmd>Outline<CR>", desc = "Toggle outline" }, | ||||
|         }, | ||||
|         opts = { | ||||
|             -- Your setup opts here | ||||
|         }, | ||||
|     }, | ||||
|     { | ||||
|         'numToStr/Comment.nvim', | ||||
|         config = function() | ||||
|             require('Comment').setup() | ||||
|         end | ||||
|     }, | ||||
|  | ||||
|     { | ||||
|         'tpope/vim-projectionist', | ||||
|         config = function() | ||||
|             vim.g.projectionist_heuristics = { | ||||
|                 ["*.go"] = { | ||||
|                     ["*.go"] = { | ||||
|                         alternate = "{}_test.go", | ||||
|                         type = "source", | ||||
|                     }, | ||||
|                     ["*_test.go"] = { | ||||
|                         alternate = "{}.go", | ||||
|                         type = "test", | ||||
|                     }, | ||||
|                 }, | ||||
|             } | ||||
|         end | ||||
|     }, | ||||
|  | ||||
|  | ||||
| } | ||||
							
								
								
									
										86
									
								
								.config/nvim/lua/halfdan/plugins/telescope.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										86
									
								
								.config/nvim/lua/halfdan/plugins/telescope.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,86 @@ | ||||
| return { | ||||
|     { | ||||
|         "fdschmidt93/telescope-egrepify.nvim", | ||||
|         dependencies = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" } | ||||
|     }, | ||||
|     { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' }, | ||||
|     { | ||||
|         'nvim-telescope/telescope.nvim', | ||||
|         config = function() | ||||
|             local actions = require('telescope.actions') | ||||
|  | ||||
|             -- Global remapping | ||||
|             require('telescope').setup { | ||||
|                 defaults = { | ||||
|                     -- find_command = { 'rg', '--no-heading', '--with-filename', '--line-number', '--column', '--smart-case' }, | ||||
|                     file_ignore_patterns = { "_build", "node_modules", "deps", ".git", ".elixir_ls" }, | ||||
|                     prompt_prefix = "  ", | ||||
|                     selection_caret = " ", | ||||
|                     entry_prefix = "  ", | ||||
|                     -- borderchars = { "█", " ", "▀", "█", "█", " ", " ", "▀" }, | ||||
|                     file_sorter = require 'telescope'.extensions.fzf.get_fzf_sorter, | ||||
|                     -- Developer configurations: Not meant for general override | ||||
|                     mappings = { | ||||
|                         i = { | ||||
|                             ["<C-j>"] = actions.move_selection_next, | ||||
|                             ["<C-k>"] = actions.move_selection_previous, | ||||
|                             ["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist, | ||||
|                             -- To disable a keymap, put [map] = false | ||||
|                             -- So, to not map "<C-n>", just put | ||||
|                             -- ["<c-x>"] = false, | ||||
|  | ||||
|                             -- Otherwise, just set the mapping to the function that you want it to be. | ||||
|                             -- ["<C-i>"] = actions.select_horizontal, | ||||
|  | ||||
|                             -- Add up multiple actions | ||||
|                             ["<CR>"] = actions.select_default + actions.center | ||||
|  | ||||
|                             -- You can perform as many actions in a row as you like | ||||
|                             -- ["<CR>"] = actions.select_default + actions.center + my_cool_custom_action, | ||||
|                         }, | ||||
|                         n = { | ||||
|                             ["<C-j>"] = actions.move_selection_next, | ||||
|                             ["<C-k>"] = actions.move_selection_previous, | ||||
|                             ["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist, | ||||
|                             ["<esc>"] = actions.close, | ||||
|                             -- ["<C-i>"] = my_cool_custom_action, | ||||
|                         } | ||||
|                     } | ||||
|                 }, | ||||
|                 pickers = { | ||||
|                     buffers = { | ||||
|                         mappings = { | ||||
|                             n = { | ||||
|                                 ['d'] = actions.delete_buffer | ||||
|                             }, -- n | ||||
|                             i = { | ||||
|                                 ['<c-d>'] = actions.delete_buffer | ||||
|                             }, | ||||
|                         } | ||||
|                     } | ||||
|                 }, | ||||
|                 extensions = { | ||||
|                     fzf = { | ||||
|                         fuzzy = true,                   -- false will only do exact matching | ||||
|                         override_generic_sorter = true, -- override the generic sorter | ||||
|                         override_file_sorter = true,    -- override the file sorter | ||||
|                         case_mode = "smart_case",       -- or "ignore_case" or "respect_case" | ||||
|                         -- the default case_mode is "smart_case" | ||||
|                         filename_first = true | ||||
|                     } | ||||
|                 }, | ||||
|             } | ||||
|  | ||||
|             require('telescope').load_extension("fzf") | ||||
|             require('telescope').load_extension("dap") | ||||
|             require('telescope').load_extension("smart_open") | ||||
|             require('telescope').load_extension("egrepify") | ||||
|         end | ||||
|     }, | ||||
|     { 'nvim-telescope/telescope-dap.nvim' }, | ||||
|     { | ||||
|         "danielfalk/smart-open.nvim", | ||||
|         branch = "0.2.x", | ||||
|         dependencies = { "kkharji/sqlite.lua" } | ||||
|     }, | ||||
| } | ||||
							
								
								
									
										7
									
								
								.config/nvim/lua/halfdan/plugins/themes.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								.config/nvim/lua/halfdan/plugins/themes.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | ||||
| return { | ||||
|   -- themes & colorschemes | ||||
|   { "rose-pine/neovim",     name = "rose-pine" }, | ||||
|   { "catppuccin/nvim", name = "catppuccin", priority = 1000 }, | ||||
|   { 'luisiacc/gruvbox-baby' }, | ||||
|   { "rebelot/kanagawa.nvim" } | ||||
| } | ||||
							
								
								
									
										84
									
								
								.config/nvim/lua/halfdan/plugins/treesitter.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										84
									
								
								.config/nvim/lua/halfdan/plugins/treesitter.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,84 @@ | ||||
| local function register(ensure_installed) | ||||
|     for filetype, parser in pairs(ensure_installed) do | ||||
|         local filetypes = vim.treesitter.language.get_filetypes(parser) | ||||
|         if not vim.tbl_contains(filetypes, filetype) then | ||||
|             table.insert(filetypes, filetype) | ||||
|         end | ||||
|  | ||||
|         -- register and start parsers for filetypes | ||||
|         vim.treesitter.language.register(parser, filetypes) | ||||
|     end | ||||
| end | ||||
|  | ||||
| --- Install and start parsers for nvim-treesitter. | ||||
| local function install_and_start() | ||||
|     -- Auto-install and start treesitter parser for any buffer with a registered filetype | ||||
|     vim.api.nvim_create_autocmd({ "BufWinEnter" }, { | ||||
|         callback = function(event) | ||||
|             local bufnr = event.buf | ||||
|             local filetype = vim.api.nvim_get_option_value("filetype", { buf = bufnr }) | ||||
|  | ||||
|             -- Skip if no filetype | ||||
|             if filetype == "" then | ||||
|                 return | ||||
|             end | ||||
|  | ||||
|             -- Get parser name based on filetype | ||||
|             local parser_name = vim.treesitter.language.get_lang(filetype) -- WARNING: might return filetype (not helpful) | ||||
|             if not parser_name then | ||||
|                 return | ||||
|             end | ||||
|  | ||||
|             vim.notify( | ||||
|                 vim.inspect("Successfully got parser " .. parser_name .. " for filetype " .. filetype), | ||||
|                 vim.log.levels.DEBUG, | ||||
|                 { title = "core/treesitter" } | ||||
|             ) | ||||
|  | ||||
|             -- Check if parser_name is available in parser configs | ||||
|             local parser_configs = require("nvim-treesitter.parsers") | ||||
|             local parser_can_be_used = parser_configs[parser_name] | ||||
|             if not parser_can_be_used then | ||||
|                 return -- Parser not ailable, skip silently | ||||
|             end | ||||
|  | ||||
|             local parser_installed = pcall(vim.treesitter.get_parser, bufnr, parser_name) | ||||
|  | ||||
|             -- If not installed, install parser synchronously | ||||
|             if not parser_installed then | ||||
|                 require("nvim-treesitter").install({ parser_name }):wait(30000) -- main branch syntax | ||||
|                 vim.notify("Installed parser: " .. parser_name, vim.log.levels.INFO, { title = "core/treesitter" }) | ||||
|             end | ||||
|  | ||||
|             -- Check so tree-sitter can see the newly installed parser | ||||
|             parser_installed = pcall(vim.treesitter.get_parser, bufnr, parser_name) | ||||
|             if not parser_installed then | ||||
|                 return | ||||
|             end | ||||
|  | ||||
|             -- Start treesitter for this buffer | ||||
|             vim.treesitter.start(bufnr, parser_name) | ||||
|         end, | ||||
|     }) | ||||
| end | ||||
|  | ||||
| return { | ||||
|     -- Treesitter | ||||
|     { | ||||
|         'nvim-treesitter/nvim-treesitter', | ||||
|         lazy = false, | ||||
|         branch = 'main', | ||||
|         build = ':TSUpdate', | ||||
|         opts = { | ||||
|             ensure_installed = { "python", "go", "elixir", "heex", "rust", "gomod", "json", "lua", "yaml", "norg", | ||||
|                 "query", "markdown", "markdown_inline", "gleam", "zig", "odin", "terraform", "hcl" } | ||||
|         }, | ||||
|         config = function(_, opts) | ||||
|             -- Register parsers from opts.ensure_installed | ||||
|             register(opts.ensure_installed) | ||||
|  | ||||
|             -- Create autocmd which installs and starts parsers. | ||||
|             install_and_start() | ||||
|         end | ||||
|     }, | ||||
| } | ||||
							
								
								
									
										108
									
								
								.config/nvim/lua/halfdan/plugins/ui.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										108
									
								
								.config/nvim/lua/halfdan/plugins/ui.lua
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,108 @@ | ||||
| return { | ||||
|     { | ||||
|         'nvim-lualine/lualine.nvim', | ||||
|         dependencies = { 'kyazdani42/nvim-web-devicons' }, | ||||
|         event = { "BufReadPost", "BufNewFile" }, | ||||
|         opts = function() | ||||
|             local monokai_opts = require("halfdan.util").opts("monokai-pro.nvim") | ||||
|             return { | ||||
|                 float = vim.tbl_contains(monokai_opts.background_clear or {}, "neo-tree"), | ||||
|                 separator = "bubble", -- bubble | triangle | ||||
|                 ---@type any | ||||
|                 colorful = true, | ||||
|             } | ||||
|         end, | ||||
|         config = function(_, opts) | ||||
|             local lualine_config = require("halfdan.lualine") | ||||
|             lualine_config.setup(opts) | ||||
|             lualine_config.load() | ||||
|         end, | ||||
|     }, | ||||
|     { | ||||
|         'rcarriga/nvim-notify', | ||||
|         config = function() | ||||
|             vim.notify = require('notify') | ||||
|  | ||||
|             require('notify').setup({ | ||||
|                 background_colour = "#000000", | ||||
|                 max_width = 120, | ||||
|                 max_height = 10, | ||||
|             }) | ||||
|         end | ||||
|     }, | ||||
|     { | ||||
|         "nvim-neo-tree/neo-tree.nvim", | ||||
|         branch = "v3.x", | ||||
|         dependencies = { | ||||
|             "nvim-lua/plenary.nvim", | ||||
|             "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended | ||||
|             "MunifTanjim/nui.nvim", | ||||
|             -- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information | ||||
|         } | ||||
|     }, | ||||
|     { | ||||
|         'akinsho/bufferline.nvim', | ||||
|         version = "*", | ||||
|         dependencies = 'nvim-tree/nvim-web-devicons', | ||||
|         keys = { | ||||
|             { "<C-1>",   "<Cmd>BufferLineGoToBuffer 1<CR>", desc = "Go to buffer 1" }, | ||||
|             { "<C-2>",   "<Cmd>BufferLineGoToBuffer 2<CR>", desc = "Go to buffer 2" }, | ||||
|             { "<C-3>",   "<Cmd>BufferLineGoToBuffer 3<CR>", desc = "Go to buffer 3" }, | ||||
|             { "<C-4>",   "<Cmd>BufferLineGoToBuffer 4<CR>", desc = "Go to buffer 4" }, | ||||
|             { "<C-5>",   "<Cmd>BufferLineGoToBuffer 5<CR>", desc = "Go to buffer 5" }, | ||||
|             { "<C-6>",   "<Cmd>BufferLineGoToBuffer 6<CR>", desc = "Go to buffer 6" }, | ||||
|             { "<C-7>",   "<Cmd>BufferLineGoToBuffer 7<CR>", desc = "Go to buffer 7" }, | ||||
|             { "<C-8>",   "<Cmd>BufferLineGoToBuffer 8<CR>", desc = "Go to buffer 8" }, | ||||
|             { "<C-9>",   "<Cmd>BufferLineGoToBuffer 9<CR>", desc = "Go to buffer 9" }, | ||||
|             { "<S-l>",   "<Cmd>BufferLineCycleNext<CR>",    desc = "Next buffer" }, | ||||
|             { "<S-h>",   "<Cmd>BufferLineCyclePrev<CR>",    desc = "Previous buffer" }, | ||||
|             { "<A-S-l>", "<Cmd>BufferLineMoveNext<CR>",     desc = "Move buffer right" }, | ||||
|             { "<A-S-h>", "<Cmd>BufferLineMovePrev<CR>",     desc = "Move buffer left" }, | ||||
|         }, | ||||
|         opts = function() | ||||
|             local monokai_opts = require("halfdan.util").opts("monokai-pro.nvim") | ||||
|             return { | ||||
|                 options = { | ||||
|                     diagnostics = "nvim_lsp",     -- | "nvim_lsp" | "coc", | ||||
|                     -- separator_style = "", -- | "thick" | "thin" | "slope" | { 'any', 'any' }, | ||||
|                     separator_style = { "", "" }, -- | "thick" | "thin" | { 'any', 'any' }, | ||||
|                     -- separator_style = "slant", -- | "thick" | "thin" | { 'any', 'any' }, | ||||
|                     indicator = { | ||||
|                         -- icon = " ", | ||||
|                         -- style = 'icon', | ||||
|                         style = "underline", | ||||
|                     }, | ||||
|                     close_command = "Bdelete! %d", -- can be a string | function, see "Mouse actions" | ||||
|                     diagnostics_indicator = function(count, _, _, _) | ||||
|                         if count > 9 then | ||||
|                             return "9+" | ||||
|                         end | ||||
|                         return tostring(count) | ||||
|                     end, | ||||
|                     numbers = function(opts) | ||||
|                         return string.format('%s', opts.raise(opts.ordinal)) | ||||
|                     end, | ||||
|                     offsets = { | ||||
|                         { | ||||
|                             filetype = "neo-tree", | ||||
|                             text = "EXPLORER", | ||||
|                             text_align = "center", | ||||
|                             separator = vim.tbl_contains(monokai_opts.background_clear or {}, "neo-tree"), -- set to `true` if clear background of neo-tree | ||||
|                         }, | ||||
|                         { | ||||
|                             filetype = "NvimTree", | ||||
|                             text = "EXPLORER", | ||||
|                             text_align = "center", | ||||
|                             separator = vim.tbl_contains(monokai_opts.background_clear or {}, "nvim-tree"), -- set to `true` if clear background of neo-tree | ||||
|                         }, | ||||
|                     }, | ||||
|                     hover = { | ||||
|                         enabled = true, | ||||
|                         delay = 0, | ||||
|                         reveal = { "close" }, | ||||
|                     }, | ||||
|                 }, | ||||
|             } | ||||
|         end, | ||||
|     }, | ||||
| } | ||||
| @@ -1,8 +0,0 @@ | ||||
| if vim.g.vscode then | ||||
|   return | ||||
| end | ||||
|  | ||||
| -- Global remapping | ||||
| ------------------------------ | ||||
| -- '--color=never', | ||||
| require'telescope'.load_extension('project') | ||||
| @@ -1,68 +0,0 @@ | ||||
| local actions = require('telescope.actions') | ||||
|  | ||||
| -- Global remapping | ||||
| require('telescope').setup { | ||||
|   defaults = { | ||||
|     -- find_command = { 'rg', '--no-heading', '--with-filename', '--line-number', '--column', '--smart-case' }, | ||||
|     file_ignore_patterns = { "_build", "node_modules", "deps", ".git", ".elixir_ls" }, | ||||
|     prompt_prefix = "  ", | ||||
|     selection_caret = " ", | ||||
|     entry_prefix = "  ", | ||||
|     -- borderchars = { "█", " ", "▀", "█", "█", " ", " ", "▀" }, | ||||
|     file_sorter = require 'telescope'.extensions.fzf.get_fzf_sorter, | ||||
|     -- Developer configurations: Not meant for general override | ||||
|     mappings = { | ||||
|       i = { | ||||
|         ["<C-j>"] = actions.move_selection_next, | ||||
|         ["<C-k>"] = actions.move_selection_previous, | ||||
|         ["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist, | ||||
|         -- To disable a keymap, put [map] = false | ||||
|         -- So, to not map "<C-n>", just put | ||||
|         -- ["<c-x>"] = false, | ||||
|  | ||||
|         -- Otherwise, just set the mapping to the function that you want it to be. | ||||
|         -- ["<C-i>"] = actions.select_horizontal, | ||||
|  | ||||
|         -- Add up multiple actions | ||||
|         ["<CR>"] = actions.select_default + actions.center | ||||
|  | ||||
|         -- You can perform as many actions in a row as you like | ||||
|         -- ["<CR>"] = actions.select_default + actions.center + my_cool_custom_action, | ||||
|       }, | ||||
|       n = { | ||||
|         ["<C-j>"] = actions.move_selection_next, | ||||
|         ["<C-k>"] = actions.move_selection_previous, | ||||
|         ["<C-q>"] = actions.smart_send_to_qflist + actions.open_qflist, | ||||
|         ["<esc>"] = actions.close, | ||||
|         -- ["<C-i>"] = my_cool_custom_action, | ||||
|       } | ||||
|     } | ||||
|   }, | ||||
|   pickers = { | ||||
|     buffers = { | ||||
|       mappings = { | ||||
|         n = { | ||||
|           ['d'] = actions.delete_buffer | ||||
|         }, -- n | ||||
|         i = { | ||||
|           ['<c-d>'] = actions.delete_buffer | ||||
|         }, | ||||
|       } | ||||
|     } | ||||
|   }, | ||||
|   extensions = { | ||||
|     fzf = { | ||||
|       fuzzy = true,                    -- false will only do exact matching | ||||
|       override_generic_sorter = true,  -- override the generic sorter | ||||
|       override_file_sorter = true,     -- override the file sorter | ||||
|       case_mode = "smart_case",        -- or "ignore_case" or "respect_case" | ||||
|                                        -- the default case_mode is "smart_case" | ||||
|       filename_first = true | ||||
|     } | ||||
|   }, | ||||
| } | ||||
|  | ||||
| require('telescope').load_extension("fzf") | ||||
| require('telescope').load_extension("dap") | ||||
| require('telescope').load_extension("smart_open") | ||||
| require('telescope').load_extension("egrepify") | ||||
| @@ -1,23 +0,0 @@ | ||||
| if vim.g.vscode then | ||||
|   return | ||||
| end | ||||
|  | ||||
| require('nvim-treesitter').setup({ | ||||
|   ensure_installed = { "python", "go", "elixir", "heex", "rust", "gomod", "json", "lua", "yaml", "norg", "query", "markdown", "markdown_inline", "gleam", "zig", "odin"}, | ||||
|   ignore_install = { "haskell" }, | ||||
|   highlight = { | ||||
|     enable = true, | ||||
|   }, | ||||
|   indent = { | ||||
|     enable = true, | ||||
|   }, | ||||
|   incremental_selection = { | ||||
|     enable = true, | ||||
|     keymaps = { | ||||
|       init_selection = "gnn", | ||||
|       node_incremental = "grn", | ||||
|       scope_incremental = "grc", | ||||
|       node_decremental = "grm", | ||||
|     }, | ||||
|   }, | ||||
| }) | ||||
		Reference in New Issue
	
	Block a user