diff --git a/ftplugin/java.lua b/ftplugin/java.lua index eb74dae..d726326 100644 --- a/ftplugin/java.lua +++ b/ftplugin/java.lua @@ -27,6 +27,23 @@ keymap('v', 'jm', "lua require('jdtls').extract_method(true) vim.api.nvim_create_autocmd({ 'FileType' }, { pattern = { 'qf', 'help', 'man', 'lspinfo', 'spectre_panel', 'lir' }, - callback = function() - vim.cmd [[ - nnoremap q :close - set nobuflisted - ]] + callback = function(event) + vim.bo[event.buf].buflisted = false + vim.keymap.set("n", "q", "close", { buffer = event.buf, silent = true }) end, }) --- use 2 spaces for cpp vim.api.nvim_create_autocmd({ 'FileType' }, { pattern = { 'cpp', 'cc', 'hpp', 'hh', 'md', 'markdown', 'java' }, callback = function() - vim.opt.ts = 4 - vim.opt.sw = 4 + vim.opt.ts = 2 + vim.opt.sw = 2 vim.opt.expandtab = true end, }) --- Fixes Autocomment -vim.api.nvim_create_autocmd({ 'BufWinEnter' }, { - callback = function() - vim.cmd 'set formatoptions-=cro' - end, -}) - --- Highlight Yanked Text +-- Highlight on yank vim.api.nvim_create_autocmd({ 'TextYankPost' }, { callback = function() vim.highlight.on_yank { higroup = 'Visual', timeout = 200 } end, }) --- vim.api.nvim_create_augroup('diagnostics', { clear = true }) --- --- vim.api.nvim_create_autocmd({ 'DiagnosticChanged' }, { --- group = 'diagnostics', --- callback = function() --- vim.diagnostic.setloclist { open = false } --- end, --- }) - -- resize splits if window got resized -vim.api.nvim_create_autocmd({ 'VimResized' }, { - group = augroup 'resize_splits', +vim.api.nvim_create_autocmd({ "VimResized" }, { callback = function() - vim.cmd 'tabdo wincmd =' + local current_tab = vim.fn.tabpagenr() + vim.cmd("tabdo wincmd =") + vim.cmd("tabnext " .. current_tab) end, }) --- wrap and check for spell in text filetypes vim.api.nvim_create_autocmd('FileType', { - group = augroup 'wrap_spell', pattern = { 'gitcommit', 'markdown' }, callback = function() vim.opt_local.wrap = true @@ -67,12 +40,6 @@ vim.api.nvim_create_autocmd('FileType', { vim.opt_local.textwidth = 80 end, }) -vim.cmd [[ - augroup change_cursor - au! - au ExitPre * :set guicursor=a:hor90 - augroup END -]] function _G.set_terminal_keymaps() local opts = { buffer = 0 } @@ -83,9 +50,26 @@ end -- if you only want these mappings for toggle term use term://*toggleterm#* instead vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()') -vim.api.nvim_create_autocmd({ 'BufWritePost' }, { - pattern = { '*.java' }, - callback = function() - vim.lsp.codelens.refresh() +-- go to last loc when opening a buffer +vim.api.nvim_create_autocmd("BufReadPost", { + callback = function(event) + local exclude = { "gitcommit" } + local buf = event.buf + if vim.tbl_contains(exclude, vim.bo[buf].filetype) or vim.b[buf].lazyvim_last_loc then + return + end + vim.b[buf].lazyvim_last_loc = true + local mark = vim.api.nvim_buf_get_mark(buf, '"') + local lcount = vim.api.nvim_buf_line_count(buf) + if mark[1] > 0 and mark[1] <= lcount then + pcall(vim.api.nvim_win_set_cursor, 0, mark) + end end, }) + +vim.cmd [[ + augroup change_cursor + au! + au ExitPre * :set guicursor=a:hor90 + augroup END +]] diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index b67e8e3..acf23b4 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -1,3 +1,16 @@ +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, + }) +end +vim.opt.rtp:prepend(lazypath) + require('lazy').setup('plugins', { defaults = { lazy = true }, change_detection = { @@ -6,13 +19,13 @@ require('lazy').setup('plugins', { performance = { reset_packpath = true, rtp = { - reset = true, + -- reset = true, -- paths = { '~/.local/share/nvim/site/' }, disabled_plugins = { 'fzf', 'gzip', - 'matchit', - 'matchparen', + -- 'matchit', + -- 'matchparen', 'netrwPlugin', 'netrw', 'tarPlugin', diff --git a/lua/config/mappings.lua b/lua/config/mappings.lua index a23baf6..7aa3fa7 100644 --- a/lua/config/mappings.lua +++ b/lua/config/mappings.lua @@ -3,8 +3,8 @@ local keymap = vim.api.nvim_set_keymap keymap('n', '', 'silent! NeoSwapPrev', opt) keymap('n', '', 'silent! NeoSwapNext', opt) --- TODO: Remove this keymap('n', '', 'Lazy profile', opt) + -- resize {{{ keymap('n', '', 'resize -2', opt) keymap('n', '', 'resize +2', opt) @@ -21,6 +21,7 @@ inoremap :m .+1==gi inoremap :m .-2==gi vnoremap M :m '>+1gv=gv vnoremap L :m '<-2gv=gv +imap [s1z=`]a ]]) keymap('n', 'Y', '"+y', opt) @@ -41,29 +42,9 @@ keymap('t', '', 'ToggleTerm direction=float', opt) keymap('v', '', 'ToggleTerm direction=float', opt) keymap('i', '', 'ToggleTerm direction=float', opt) -- }}} --- trouble {{{ -vim.api.nvim_set_keymap('n', 'xl', 'TroubleToggle loclist', { silent = true, noremap = true }) -vim.api.nvim_set_keymap('n', 'xq', 'TroubleToggle quickfix', { silent = true, noremap = true }) -vim.api.nvim_set_keymap('n', 'xx', 'TroubleToggle', { silent = true, noremap = true }) -vim.api.nvim_set_keymap( - 'n', - 'xw', - 'TroubleToggle workspace_diagnostics', - { silent = true, noremap = true } -) -vim.api.nvim_set_keymap( - 'n', - 'xd', - 'TroubleToggle document_diagnostics', - { silent = true, noremap = true } -) --- }}} keymap('n', '', ':', { noremap = true }) keymap('n', ';', ':', { noremap = true }) -keymap('n', 'rs', ':s///gI', { noremap = true }) -keymap('n', 'rr', ':%s///gI', { noremap = true }) -keymap('v', 'r', ':s///gI', { noremap = true }) keymap('n', 'D', '"_d', { noremap = true }) @@ -84,19 +65,22 @@ keymap('n', 'ls', 'lua vim.lsp.buf.signature_help()', opt) keymap('n', 'lq', 'lua vim.diagnostic.setloclist()', opt) keymap('n', 'e', 'lua vim.diagnostic.open_float()', opt) +keymap('n', 'rs', ':s///gI', { noremap = true }) +keymap('n', 'rr', ':%s///gI', { noremap = true }) +keymap('v', 'r', ':s///gI', { noremap = true }) function MapDHM() keymap('n', 'i', 'l', { noremap = true }) keymap('n', 'n', 'j', { noremap = true }) keymap('n', 'e', 'k', { noremap = true }) + keymap('n', 'l', 'i', { noremap = true }) + keymap('n', 'j', 'n', { noremap = true }) + keymap('n', 'J', 'N', { noremap = true }) + keymap('n', 'N', 'J', { noremap = true }) keymap('x', 'l', 'i', { noremap = true }) keymap('x', 'i', 'l', { noremap = true }) keymap('x', 'n', 'j', { noremap = true }) keymap('x', 'e', 'k', { noremap = true }) - keymap('n', 'l', 'i', { noremap = true }) - keymap('n', 'N', 'J', { noremap = true }) - keymap('n', 'j', 'n', { noremap = true }) - keymap('n', 'J', 'N', { noremap = true }) keymap('n', '', 'I', { noremap = true }) end @@ -188,7 +172,6 @@ vim.keymap.set('n', 'X', function() end, { noremap = true, silent = true }) ]] -- }}} -- leader mappings {{{ --- TODO create entire treesitter section local mappings = { [''] = { function() @@ -196,6 +179,8 @@ local mappings = { end, 'Buffers', }, + ['s'] = { 'ASToggle', 'Auto Save toggle' }, + ['D'] = { 'Dashboard', 'Dashboard' }, ['.'] = { 'Oil', 'Oil' }, ['f'] = { 'e ~/.config/nvim/ ', 'Neovim config' }, ['rr'] = 'Search and replace all', @@ -253,7 +238,35 @@ local mappings = { }, ['g'] = { 'Neogit', 'Neogit' }, d = { - s = { 'Lazy load nvim-gdb ', 'Load GDB' }, + S = { 'Lazy load nvim-gdb ', 'Load GDB' }, + b = { "DapToggleBreakpoint", "Toggle Breakpoint" }, + c = { "DapContinue", "Continue" }, + n = { "DapStepOver", "Step Over" }, + i = { "DapStepInto", "Step Into" }, + o = { "DapStepOut", "Step Out" }, + d = { + function() + require("dapui").toggle() + end, + "Toggle DAP UI" }, + s = { + function() + require("dapui").float_element("scopes", _) + end, + "Scopes" + }, + r = { + function() + require("dapui").float_element("repl", _) + end, + "REPL" + }, + C = { + function() + require("dapui").float_element("console", _) + end, + "Console" + }, }, l = { name = 'LSP', @@ -288,6 +301,14 @@ local mappings = { v = { 'v', 'Vertical split' }, h = { 's', 'Horizontal split' }, }, + x = { + name = 'Trouble', + l = { 'TroubleToggle loclist', 'Loclist' }, + q = { 'TroubleToggle quickfix', 'Quickfix' }, + x = { 'TroubleToggle', 'Toggle' }, + w = { 'TroubleToggle workspace_diagnostics', 'Workspace' }, + d = { 'TroubleToggle document_diagnostics', 'Document' }, + }, } -- }}} wk.register(mappings, opts) diff --git a/lua/config/settings.lua b/lua/config/options.lua similarity index 57% rename from lua/config/settings.lua rename to lua/config/options.lua index 1fd1c31..ecabd11 100644 --- a/lua/config/settings.lua +++ b/lua/config/options.lua @@ -36,13 +36,14 @@ let g:nvimgdb_config_override = { opt.termguicolors = true opt.mouse = 'nv' -opt.fileencoding = 'utf-8' +-- opt.fileencoding = 'utf-8' opt.splitbelow = true opt.splitright = true opt.showmode = false opt.undofile = true opt.updatetime = 300 opt.backup = false +-- vim.api.nvim_set_option("clipboard","unnamed") opt.clipboard:prepend { 'unnamedplus', 'unnamed' } opt.ignorecase = true opt.smartcase = true @@ -56,52 +57,8 @@ opt.fillchars = 'eob: ' opt.cmdheight = 1 opt.grepprg = 'rg --vimgrep --no-heading --smart-case --hidden' opt.grepformat = '%f:%l:%c:%m' +opt.cursorline = true +opt.cursorlineopt = 'number' vim.api.nvim_create_user_command('Cd', 'lcd %:p:h', { nargs = 0 }) vim.api.nvim_create_user_command('Grep', 'silent grep! | TroubleToggle quickfix', { nargs = '+' }) - -local ignore_buftype = { 'quickfix', 'nofile', 'help' } -local ignore_filetype = { 'gitcommit', 'gitrebase', 'svn', 'hgcommit' } - -local function run() - if vim.tbl_contains(ignore_buftype, vim.bo.buftype) then - return - end - - if vim.tbl_contains(ignore_filetype, vim.bo.filetype) then - -- reset cursor to first line - vim.cmd [[normal! gg]] - return - end - - -- If a line has already been specified on the command line, we are done - -- nvim file +num - if vim.fn.line '.' > 1 then - vim.cmd [[normal! zz]] - return - end - - local last_line = vim.fn.line [['"]] - local buff_last_line = vim.fn.line '$' - - -- If the last line is set and the less than the last line in the buffer - if last_line > 0 and last_line <= buff_last_line then - local win_last_line = vim.fn.line 'w$' - local win_first_line = vim.fn.line 'w0' - -- Check if the last line of the buffer is the same as the win - if win_last_line == buff_last_line then - -- Set line to last line edited - vim.cmd [[normal! g`"]] - -- Try to center - elseif buff_last_line - last_line > ((win_last_line - win_first_line) / 2) - 1 then - vim.cmd [[normal! g`"zz]] - else - vim.cmd [[normal! G'"]] - end - end -end - -vim.api.nvim_create_autocmd({ 'BufWinEnter', 'FileType' }, { - group = vim.api.nvim_create_augroup('nvim-lastplace', {}), - callback = run, -}) diff --git a/lua/config/utils.lua b/lua/config/utils.lua index 84ac0f0..a04dc25 100644 --- a/lua/config/utils.lua +++ b/lua/config/utils.lua @@ -5,40 +5,7 @@ M.has_words_before = function() return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match '%s' == nil end -M.lsp_config = { - -- virtual_text = { - -- prefix = '●', - -- }, - virtual_text = false, - signs = false, - underline = true, - update_in_insert = false, - severity_sort = false, - float = { - focusable = false, - -- style = 'minimal', - border = 'rounded', - source = 'always', - header = '', - prefix = '', - }, -} - -M.lspservername = function() - local msg = '' - local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype') - local clients = vim.lsp.get_active_clients() - if next(clients) == nil then return msg end - for _, client in ipairs(clients) do - local filetypes = client.config.filetypes - if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then - return client.name - end - end - return msg -end - -M.feline_theme = { +M.feline_theme_dark = { fg = '#c9d1d9', bg = '#101010', green = '#66cc66', @@ -53,6 +20,21 @@ M.feline_theme = { normal = '#A9A9A9' } +M.feline_theme_light = { + bg = '#c9d1d9', + fg = '#101010', + green = '#66cc66', + yellow = '#cca300', + purple = '#c678dd', + orange = '#cc8c3c', + peanut = '#f6d5a4', + red = '#e06c75', + aqua = '#61afef', + bg2 = '#484848', + dark_red = '#f75f5f', + normal = '#A9A9A9' +} + M.feline_vi_mode_colors = { NORMAL = 'normal', OP = 'green', @@ -71,18 +53,18 @@ local left_component_separator = { fg = '#4a4a4a', }, } -local right_component_separator = { - str = ' ', - hl = { - fg = '#4a4a4a', - }, -} -local left_section_separator = { - str = '█', - hl = { - fg = 'normal', - }, -} +-- local right_component_separator = { +-- str = ' ', +-- hl = { +-- fg = '#4a4a4a', +-- }, +-- } +-- local left_section_separator = { +-- str = '', +-- hl = { +-- fg = 'normal', +-- }, +-- } local right_section_separator = { str = '', hl = { @@ -100,7 +82,7 @@ local function selectionCount() end local function startupTime() - return tostring(require'lazy'.stats().startuptime) + return tostring(require 'lazy'.stats().startuptime) end M.feline_c = { @@ -128,22 +110,15 @@ M.feline_c = { }, hl = function() return { - bg = require('feline.providers.vi_mode').get_mode_color(), - fg = 'bg', + fg = require('feline.providers.vi_mode').get_mode_color(), + -- fg = 'bg', style = 'bold', name = 'NeovimModeHLColor', } end, left_sep = 'block', right_sep = { - str = '█', - hl = function() - return { - fg = require('feline.providers.vi_mode').get_mode_color(), - style = 'bold', - name = 'NeovimModeHLColor', - } - end, + str = 'slant_right', }, }, diagnostic_errors = { @@ -214,22 +189,15 @@ M.feline_c = { provider = 'position', hl = function() return { - bg = require('feline.providers.vi_mode').get_mode_color(), - fg = 'bg', + fg = require('feline.providers.vi_mode').get_mode_color(), + -- fg = 'bg', style = 'bold', name = 'NeovimModeHLColor', } end, right_sep = 'block', left_sep = { - str = '█', - hl = function() - return { - fg = require('feline.providers.vi_mode').get_mode_color(), - style = 'bold', - name = 'NeovimModeHLColor', - } - end, + str = 'slant_left', }, }, startup = { diff --git a/lua/plugins/auto-save.lua b/lua/plugins/auto-save.lua new file mode 100644 index 0000000..0da6699 --- /dev/null +++ b/lua/plugins/auto-save.lua @@ -0,0 +1,30 @@ +return { + 'okuuva/auto-save.nvim', + cmd = 'ASToggle', + opts = { + enabled = false, -- start auto-save when the plugin is loaded (i.e. when your package manager loads it) + execution_message = { + enabled = true, + message = function() -- message to print on save + return ("AutoSave: saved at " .. vim.fn.strftime("%H:%M:%S")) + end, + dim = 0.18, -- dim the color of `message` + cleaning_interval = 1250, -- (milliseconds) automatically clean MsgArea after displaying `message`. See :h MsgArea + }, + trigger_events = { -- See :h events + immediate_save = { "BufLeave", "FocusLost" }, -- vim events that trigger an immediate save + defer_save = { "InsertLeave", "TextChanged" }, -- vim events that trigger a deferred save (saves after `debounce_delay`) + cancel_defered_save = { "InsertEnter" }, -- vim events that cancel a pending deferred save + }, + -- function that takes the buffer handle and determines whether to save the current buffer or not + -- return true: if buffer is ok to be saved + -- return false: if it's not ok to be saved + -- if set to `nil` then no specific condition is applied + condition = nil, + write_all_buffers = false, -- write all buffers when the current one meets `condition` + noautocmd = false, -- do not execute autocmds when saving + debounce_delay = 100, -- delay after which a pending save is executed + -- log debug messages to 'auto-save.log' file in neovim cache directory, set to `true` to enable + debug = false, + } +} diff --git a/lua/plugins/buffer_manager.lua b/lua/plugins/buffer_manager.lua new file mode 100644 index 0000000..11e4a89 --- /dev/null +++ b/lua/plugins/buffer_manager.lua @@ -0,0 +1,25 @@ +return { + 'j-morano/buffer_manager.nvim', + opts = { + -- line_keys = '', -- deactivate line keybindings + + short_term_names = true, + focus_alternate_buffer = true, + select_menu_item_commands = { + edit = { + key = '', + command = 'edit', + }, + v = { + key = '', + command = 'vsplit', + }, + h = { + key = '', + command = 'split', + }, + }, + width = 0.6, + highlight = "Normal:Normal", + }, +} diff --git a/lua/plugins/colorizer.lua b/lua/plugins/colorizer.lua new file mode 100644 index 0000000..0cdabec --- /dev/null +++ b/lua/plugins/colorizer.lua @@ -0,0 +1,24 @@ +return { + 'NvChad/nvim-colorizer.lua', + -- event = 'BufReadPre', + cmd = 'ColorizerToggle', + opts = { + filetypes = { '*', '!lazy' }, + buftype = { '*', '!prompt', '!nofile' }, + user_default_options = { + RGB = true, -- #RGB hex codes + RRGGBB = true, -- #RRGGBB hex codes #ffffff + names = false, -- "Name" codes like Blue + RRGGBBAA = true, -- #RRGGBBAA hex codes + AARRGGBB = false, -- 0xAARRGGBB hex codes + rgb_fn = true, -- CSS rgb() and rgba() functions + hsl_fn = true, -- CSS hsl() and hsla() functions + css = false, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB + css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn + -- Available modes: foreground, background + -- Available modes for `mode`: foreground, background, virtualtext + -- mode = "background", -- Set the display mode. + -- virtualtext = "■", + }, + }, +} diff --git a/lua/plugins/comment.lua b/lua/plugins/comment.lua new file mode 100644 index 0000000..67ca369 --- /dev/null +++ b/lua/plugins/comment.lua @@ -0,0 +1,56 @@ +return { + 'numToStr/Comment.nvim', + -- event = 'VeryLazy', + keys = { 'gcc', { 'gc', mode = 'v' }, { 'gb', mode = 'v' } }, + opts = { + -- -LHS of operator-pending mappings in NORMAL and VISUAL mode + opleader = { + ---Line-comment keymap + line = 'gc', + ---Block-comment keymap + block = 'gb', + }, + ---LHS of extra mappings + extra = { + ---Add comment on the line above + above = 'gcO', + ---Add comment on the line below + below = 'gco', + ---Add comment at the end of line + eol = 'gca', + }, + ---Enable keybindings + ---NOTE: If given `false` then the plugin won't create any mappings + mappings = { + ---Operator-pending mapping; `gcc` `gbc` `gc[count]{motion}` `gb[count]{motion}` + basic = true, + ---Extra mapping; `gco`, `gcO`, `gcA` + extra = true, + ---Extended mapping; `g>` `g<` `g>[count]{motion}` `g<[count]{motion}` + extended = false, + }, + pre_hook = function(ctx) + -- Only calculate commentstring for tsx filetypes + if vim.bo.filetype == 'typescriptreact' then + local U = require 'Comment.utils' + + -- Determine whether to use linewise or blockwise commentstring + local type = ctx.ctype == U.ctype.linewise and '__default' or '__multiline' + + -- Determine the location where to calculate commentstring from + local location = nil + if ctx.ctype == U.ctype.blockwise then + location = require('ts_context_commentstring.utils').get_cursor_location() + elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then + location = require('ts_context_commentstring.utils') + .get_visual_start_location() + end + + return require('ts_context_commentstring.internal').calculate_commentstring { + key = type, + location = location, + } + end + end, + }, +} diff --git a/lua/plugins/dap.lua b/lua/plugins/dap.lua new file mode 100644 index 0000000..fcc26d0 --- /dev/null +++ b/lua/plugins/dap.lua @@ -0,0 +1,82 @@ +return { + { 'mfussenegger/nvim-dap', }, + { + 'rcarriga/nvim-dap-ui', + opts = { + controls = { + element = "repl", + enabled = true, + icons = { + disconnect = "", + pause = "", + play = "", + run_last = "", + step_back = "", + step_into = "", + step_out = "", + step_over = "", + terminate = "" + } + }, + element_mappings = {}, + expand_lines = true, + floating = { + border = "single", + mappings = { + close = { "q", "" } + } + }, + force_buffers = true, + icons = { + collapsed = "", + current_frame = "", + expanded = "" + }, + layouts = { { + elements = { + { + id = "scopes", + size = 0.5 + }, + -- { + -- id = "breakpoints", + -- size = 0.25 + -- }, + { + id = "stacks", + size = 0.25 + }, + { + id = "watches", + size = 0.25 + } + }, + position = "right", + size = 40 + }, { + elements = { { + id = "repl", + size = 0.5 + }, { + id = "console", + size = 0.5 + } }, + position = "bottom", + size = 10 + } }, + mappings = { + edit = "e", + expand = { "", "<2-LeftMouse>" }, + open = "o", + remove = "d", + repl = "r", + toggle = "t" + }, + render = { + indent = 1, + max_value_lines = 100 + } + + }, + }, +} diff --git a/lua/plugins/feline.lua b/lua/plugins/feline.lua deleted file mode 100644 index 7eea116..0000000 --- a/lua/plugins/feline.lua +++ /dev/null @@ -1,62 +0,0 @@ -return { - 'freddiehaddad/feline.nvim', - dependencies = { - 'nvim-tree/nvim-web-devicons', - }, - config = function() - local feline = require 'feline' - local utils = require 'config.utils' - local c = utils.feline_c - local theme = utils.feline_theme - local vi_mode_colors = utils.feline_vi_mode_colors - - local left = { - c.vim_mode, - -- c.gitBranch, - -- c.gitDiffAdded, - -- c.gitDiffRemoved, - -- c.gitDiffChanged, - c.file_info, - c.right_separator, - c.lsp_client_names, - c.diagnostic_errors, - c.diagnostic_warnings, - c.diagnostic_info, - c.diagnostic_hints, - } - - -- local middle = { - -- c.separator, - -- } - - local right = { - c.file_type, - c.search_count, - c.macro, - c.file_encoding, - -- c.startup, - c.line_percentage, - c.select_count, - c.position, - } - - local components = { - active = { - left, - -- middle, - right, - }, - inactive = { - left, - -- middle, - right, - }, - } - - feline.setup { - components = components, - theme = theme, - vi_mode_colors = vi_mode_colors, - } - end, -} diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 8671886..b24fec0 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -1,346 +1,42 @@ return { - -- 'MunifTanjim/nui.nvim', + 'folke/which-key.nvim', 'nvim-lua/plenary.nvim', - -- 'mfussenegger/nvim-jdtls', + 'mfussenegger/nvim-jdtls', 'simrat39/rust-tools.nvim', + 'sakhnik/nvim-gdb', { 'mg979/vim-visual-multi', event = 'VeryLazy' }, { 'rush-rs/tree-sitter-asm', ft = 'asm' }, - { 'jghauser/mkdir.nvim', lazy = false }, + { 'jghauser/mkdir.nvim', lazy = false }, { - 'stevearc/dressing.nvim', + 'jakewvincent/mkdnflow.nvim', + dependencies = 'nvim-lua/plenary.nvim', + ft = 'markdown', opts = {}, - -- lazy = false, }, { - url = 'https://git.filnar.com/fiplox/neogruber.git', - -- dir = '~/share/dev/neogruber.nvim/', - lazy = false, - -- event = 'VeryLazy' + 'glepnir/dbsession.nvim', + cmd = { 'SessionSave', 'SessionDelete', 'SessionLoad' }, + opts = {}, }, { - 'numToStr/Comment.nvim', - -- event = 'VeryLazy', - keys = { 'gcc', { 'gc', mode = 'v' }, { 'gb', mode = 'v' } }, - opts = { - -- -LHS of operator-pending mappings in NORMAL and VISUAL mode - opleader = { - ---Line-comment keymap - line = 'gc', - ---Block-comment keymap - block = 'gb', - }, - ---LHS of extra mappings - extra = { - ---Add comment on the line above - above = 'gcO', - ---Add comment on the line below - below = 'gco', - ---Add comment at the end of line - eol = 'gca', - }, - ---Enable keybindings - ---NOTE: If given `false` then the plugin won't create any mappings - mappings = { - ---Operator-pending mapping; `gcc` `gbc` `gc[count]{motion}` `gb[count]{motion}` - basic = true, - ---Extra mapping; `gco`, `gcO`, `gcA` - extra = true, - ---Extended mapping; `g>` `g<` `g>[count]{motion}` `g<[count]{motion}` - extended = false, - }, - pre_hook = function(ctx) - -- Only calculate commentstring for tsx filetypes - if vim.bo.filetype == 'typescriptreact' then - local U = require 'Comment.utils' - - -- Determine whether to use linewise or blockwise commentstring - local type = ctx.ctype == U.ctype.linewise and '__default' or '__multiline' - - -- Determine the location where to calculate commentstring from - local location = nil - if ctx.ctype == U.ctype.blockwise then - location = require('ts_context_commentstring.utils').get_cursor_location() - elseif ctx.cmotion == U.cmotion.v or ctx.cmotion == U.cmotion.V then - location = require('ts_context_commentstring.utils') - .get_visual_start_location() - end - - return require('ts_context_commentstring.internal').calculate_commentstring { - key = type, - location = location, - } - end - end, - }, - }, - { - 'NvChad/nvim-colorizer.lua', - -- event = 'BufReadPre', - cmd = 'ColorizerToggle', - opts = { - filetypes = { '*', '!lazy' }, - buftype = { '*', '!prompt', '!nofile' }, - user_default_options = { - RGB = true, -- #RGB hex codes - RRGGBB = true, -- #RRGGBB hex codes #ffffff - names = false, -- "Name" codes like Blue - RRGGBBAA = true, -- #RRGGBBAA hex codes - AARRGGBB = false, -- 0xAARRGGBB hex codes - rgb_fn = true, -- CSS rgb() and rgba() functions - hsl_fn = true, -- CSS hsl() and hsla() functions - css = false, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB - css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn - -- Available modes: foreground, background - -- Available modes for `mode`: foreground, background, virtualtext - -- mode = "background", -- Set the display mode. - -- virtualtext = "■", - }, - }, - }, - { - 'williamboman/mason.nvim', - cmd = 'Mason', - opts = { - settings = { - ui = { - border = 'rounded', - icons = { - package_installed = '◍', - package_pending = '◍', - package_uninstalled = '◍', - }, - }, - -- log_level = vim.log.levels.INFO, - max_concurrent_installers = 4, - }, - }, - }, - { - 'NeogitOrg/neogit', - dependencies = 'sindrets/diffview.nvim', - cmd = 'Neogit', - opts = { - disable_signs = false, - disable_hint = false, - disable_context_highlighting = false, - disable_commit_confirmation = true, - -- Neogit refreshes its internal state after specific events, which can be expensive depending on the repository size. - -- Disabling `auto_refresh` will make it so you have to manually refresh the status after you open it. - auto_refresh = true, - disable_builtin_notifications = false, - use_magit_keybindings = false, - -- Change the default way of opening neogit - kind = 'tab', - -- The time after which an output console is shown for slow running commands - console_timeout = 2000, - -- Automatically show console if a command takes more than console_timeout milliseconds - auto_show_console = true, - -- Change the default way of opening the commit popup - commit_popup = { - kind = 'split', - }, - -- Change the default way of opening popups - popup = { - kind = 'split', - }, - status = { - recent_commit_count = 50, - }, - -- customize displayed signs - signs = { - -- { CLOSED, OPENED } - section = { '>', 'v' }, - item = { '>', 'v' }, - hunk = { '', '' }, - }, - integrations = { - -- Neogit only provides inline diffs. If you want a more traditional way to look at diffs, you can use `sindrets/diffview.nvim`. - -- The diffview integration enables the diff popup, which is a wrapper around `sindrets/diffview.nvim`. - -- - -- Requires you to have `sindrets/diffview.nvim` installed. - diffview = true, - }, - -- Setting any section to `false` will make the section not render at all - section = { - untracked = { - folded = false, - }, - unstaged = { - folded = false, - }, - staged = { - folded = false, - }, - stashes = { - folded = true, - }, - unpulled = { - folded = true, - }, - unmerged = { - folded = false, - }, - recent = { - folded = true, - }, - }, - -- override/add mappings - mappings = { - -- modify status buffer mappings - status = { - -- Adds a mapping with "B" as key that does the "BranchPopup" command - ['B'] = 'BranchPopup', - -- Removes the default mapping of "s" - -- ['s'] = '', - }, - }, - }, - }, - { - 'stevearc/oil.nvim', - -- lazy = false, - event = 'Syntax', - opts = { - columns = { - "mtime", - "size", - "permissions", - "icon", - }, - -- Buffer-local options to use for oil buffers - buf_options = { - buflisted = false, - }, - -- Window-local options to use for oil buffers - win_options = { - wrap = false, - signcolumn = "no", - cursorcolumn = false, - foldcolumn = "0", - spell = false, - list = false, - conceallevel = 3, - concealcursor = 'nvic', - }, - keymaps = { - ['g?'] = 'actions.show_help', - [''] = 'actions.select', - [''] = 'actions.select_vsplit', - [''] = 'actions.select_split', - [''] = 'actions.preview', - [''] = 'actions.preview', - [''] = 'actions.close', - ['q'] = 'actions.close', - [''] = 'actions.refresh', - ['-'] = 'actions.parent', - ['l'] = 'actions.parent', - ['_'] = 'actions.open_cwd', - ['`'] = 'actions.cd', - ['~'] = 'actions.tcd', - ['g.'] = 'actions.toggle_hidden', - }, - }, - }, - { - 'akinsho/toggleterm.nvim', - cmd = 'ToggleTerm', - opts = { - -- size can be a number or function which is passed the current terminal - -- size = function(term) - -- if term.direction == 'horizontal' then - -- return 15 - -- elseif term.direction == 'vertical' then - -- return vim.o.columns * 0.4 - -- end - -- end, - shade_filetypes = { 'none', 'fzf' }, - -- open_mapping = [[]], - hide_numbers = true, -- hide the number column in toggleterm buffers - shade_terminals = true, - shading_factor = '2', -- the degree by which to darken to terminal colour, default: 1 for dark backgrounds, 3 for light - start_in_insert = true, - insert_mappings = true, -- whether or not the open mapping applies in insert mode - persist_size = true, - -- direction = 'horizontal', -- 'vertical' | 'horizontal' | 'window' | 'float', - direction = 'float', -- 'vertical' | 'horizontal' | 'window' | 'float', - close_on_exit = true, -- close the terminal window when the process exits - shell = vim.o.shell, -- change the default shell - -- This field is only relevant if direction is set to 'float' - float_opts = { - -- The border key is *almost* the same as 'nvim_win_open' - -- see :h nvim_win_open for details on borders however - -- the 'curved' border is a custom border type - -- not natively supported but implemented in this plugin. - border = 'curved', -- | 'double' | 'shadow' | 'curved' --| ... other options supported by win open - -- width = 100, - -- height = 30, - -- winblend = 20, - -- highlights = { - -- border = 'Normal', - -- background = 'Normal', - -- }, - }, - }, - }, - { - 'nvim-treesitter/nvim-treesitter', - -- lazy = false, - -- dependencies = { 'nvim-treesitter/playground' }, - -- dependencies = 'windwp/nvim-ts-autotag', - event = 'VeryLazy', - config = function() - require('nvim-treesitter.parsers').get_parser_configs().asm = { - install_info = { - url = 'https://github.com/rush-rs/tree-sitter-asm.git', - files = { 'src/parser.c' }, - branch = 'main', - }, - } - local configs = require 'nvim-treesitter.configs' - - configs.setup { - ignore_install = { 'haskell' }, - highlight = { - enable = true, -- false will disable the whole extension - disable = { 'html' }, - }, - -- context_commentstring = { enable = true, config = { css = '// %s' } }, - -- indent = {enable = true, disable = {"python", "html", "javascript"}}, - -- TODO seems to be broken - indent = { enable = true, disable = { 'python', 'css' } }, - -- autotag = { enable = true }, - } + "stevearc/dressing.nvim", + lazy = true, + init = function() + ---@diagnostic disable-next-line: duplicate-set-field + vim.ui.select = function(...) + require("lazy").load({ plugins = { "dressing.nvim" } }) + return vim.ui.select(...) + end + ---@diagnostic disable-next-line: duplicate-set-field + vim.ui.input = function(...) + require("lazy").load({ plugins = { "dressing.nvim" } }) + return vim.ui.input(...) + end end, }, - { - 'j-morano/buffer_manager.nvim', - opts = { - -- line_keys = '', -- deactivate line keybindings - - focus_alternate_buffer = true, - select_menu_item_commands = { - edit = { - key = '', - command = 'edit', - }, - v = { - key = '', - command = 'vsplit', - }, - h = { - key = '', - command = 'split', - }, - }, - width = 0.6, - }, - }, { "ecthelionvi/NeoSwap.nvim", opts = {} }, - { - 'sakhnik/nvim-gdb' - }, } diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua new file mode 100644 index 0000000..4bbecec --- /dev/null +++ b/lua/plugins/lsp.lua @@ -0,0 +1,44 @@ +return { + 'neovim/nvim-lspconfig', + name = 'lsp', + ft = 'java', + dependencies = { 'williamboman/mason.nvim', 'williamboman/mason-lspconfig.nvim' }, + opts = { + -- options for vim.diagnostic.config() + diagnostics = { + underline = true, + update_in_insert = false, + signs = false, + virtual_text = { + source = "if_many", + prefix = "●", + -- this will set set the prefix to a function that returns the diagnostics icon based on the severity + -- this only works on a recent 0.10.0 build. Will be set to "●" when not supported + -- prefix = "icons", + }, + float = { + focusable = false, + -- style = 'minimal', + border = 'rounded', + source = 'always', + header = '', + prefix = '', + }, + severity_sort = true, + }, + }, + config = function(_, opts) + vim.diagnostic.config(vim.deepcopy(opts.diagnostics)) + -- vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(vim.lsp.handlers.hover, { + -- border = 'rounded', + -- }) + -- vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(vim.lsp.handlers.signature_help, { + -- border = 'rounded', + -- }) + local on_references = vim.lsp.handlers['textDocument/references'] + vim.lsp.handlers['textDocument/references'] = vim.lsp.with(on_references, { + -- Use location list instead of quickfix list + loclist = true, + }) + end +} diff --git a/lua/plugins/lsp/init.lua b/lua/plugins/lsp/init.lua deleted file mode 100644 index 25f6445..0000000 --- a/lua/plugins/lsp/init.lua +++ /dev/null @@ -1,20 +0,0 @@ -return { - 'neovim/nvim-lspconfig', - name = 'lsp', - config = function() - require('mason') - require('mason-lspconfig') - vim.diagnostic.config(require('config.utils').lsp_config) - -- vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(vim.lsp.handlers.hover, { - -- border = 'rounded', - -- }) - -- vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(vim.lsp.handlers.signature_help, { - -- border = 'rounded', - -- }) - local on_references = vim.lsp.handlers['textDocument/references'] - vim.lsp.handlers['textDocument/references'] = vim.lsp.with(on_references, { - -- Use location list instead of quickfix list - loclist = true, - }) - end -} diff --git a/lua/plugins/mason-lspconfig.lua b/lua/plugins/mason-lspconfig.lua deleted file mode 100644 index 206ee6f..0000000 --- a/lua/plugins/mason-lspconfig.lua +++ /dev/null @@ -1,99 +0,0 @@ -return { - 'williamboman/mason-lspconfig.nvim', - config = function() - local cmp_nvim_lsp = require 'cmp_nvim_lsp' - local capabilities = cmp_nvim_lsp.default_capabilities() - local lspconfig = require 'lspconfig' - local function on_attach(client, bufnr) - --[[ vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') ]] - if client.name == 'jdtls' or client.name == 'jdt.ls' then - client.server_capabilities.documentFormattingProvider = false - vim.lsp.codelens.refresh() - if JAVA_DAP_ACTIVE then - require('jdtls').setup_dap { hotcodereplace = 'auto' } - require('jdtls.setup').add_commands() - require('jdtls.dap').setup_dap_main_class_configs() - end - end - -- -- util.info(client.name .. " " .. (enable and "yes" or "no"), "format") - client.server_capabilities.documentFormattingProvider = true - -- client.server_capabilities.documentFormattingProvider = true - client.server_capabilities.semanticTokensProvider = nil - end - - require('mason-lspconfig').setup_handlers { - function(server_name) -- default handler (optional) - lspconfig[server_name].setup { - on_attach = on_attach, - capabilities = capabilities, - } - end, - ['clangd'] = function() - local clangd_flags = { - '-j=5', - '--all-scopes-completion', - '--suggest-missing-includes', - '--background-index', - '--pch-storage=disk', - '--cross-file-rename', - '--log=info', - '--completion-style=detailed', - '--enable-config', -- clangd 11+ supports reading from .clangd configuration file - '--clang-tidy', - -- "--clang-tidy-checks=-*,llvm-*,clang-analyzer-*,modernize-*,-modernize-use-trailing-return-type", - -- "--fallback-style=Google", - -- "--header-insertion=never", - -- "--query-driver=" - } - lspconfig.clangd.setup { - on_attach = on_attach, - capabilities = capabilities, - arg = { - unpack(clangd_flags) - } - } - end, - ['lua_ls'] = function() - lspconfig.lua_ls.setup { - on_attach = on_attach, - capabilities = capabilities, - flags = { - debounce_text_changes = 150, - }, - settings = { - Lua = { - diagnostics = { - globals = { 'vim' }, - }, - -- workspace = { - -- library = { - -- [vim.fn.expand '$VIMRUNTIME/lua'] = true, - -- [vim.fn.stdpath 'config' .. '/lua'] = true, - -- }, - -- }, - telemetry = { - enable = false, - }, - }, - }, - } - end, - ['jdtls'] = function() - end, - ['rust_analyzer'] = function() - require('rust-tools').setup { - server = { - on_attach = on_attach, - standalone = false, - }, - } - end, - } - end -} --- if server == 'elixirls' then --- local elixir_opts = { --- cmd = { "/home/user/.local/share/nvim/mason/packages/elixir-ls/language_server.sh" }, --- } --- opts = vim.tbl_deep_extend('force', elixir_opts, opts) --- end diff --git a/lua/plugins/mason.lua b/lua/plugins/mason.lua new file mode 100644 index 0000000..3a4de64 --- /dev/null +++ b/lua/plugins/mason.lua @@ -0,0 +1,164 @@ +return { + { + 'williamboman/mason.nvim', + cmd = 'Mason', + opts = { + settings = { + ui = { + border = 'rounded', + icons = { + package_installed = '◍', + package_pending = '◍', + package_uninstalled = '◍', + }, + }, + -- log_level = vim.log.levels.INFO, + max_concurrent_installers = 4, + }, + }, + }, + { + "jay-babu/mason-nvim-dap.nvim", + opts = { + ensure_installed = { 'javatest', 'javadbg', 'codelldb' }, + handlers = { + function(config) + -- all sources with no handler get passed here + + -- Keep original functionality + require('mason-nvim-dap').default_setup(config) + end, + -- python = function(config) + -- config.adapters = { + -- type = "executable", + -- command = "/usr/bin/python3", + -- args = { + -- "-m", + -- "debugpy.adapter", + -- }, + -- } + -- require('mason-nvim-dap').default_setup(config) -- don't forget this! + -- end, + }, + } + }, + { + 'williamboman/mason-lspconfig.nvim', + dependencies = { 'jay-babu/mason-nvim-dap.nvim', 'rcarriga/nvim-dap-ui' }, + config = function() + local cmp_nvim_lsp = require 'cmp_nvim_lsp' + local capabilities = cmp_nvim_lsp.default_capabilities() + local lspconfig = require 'lspconfig' + capabilities.textDocument.completion.completionItem = { + documentationFormat = { "markdown", "plaintext" }, + snippetSupport = true, + preselectSupport = true, + insertReplaceSupport = true, + labelDetailsSupport = true, + deprecatedSupport = true, + commitCharactersSupport = true, + tagSupport = { valueSet = { 1 } }, + resolveSupport = { + properties = { + "documentation", + "detail", + "additionalTextEdits", + }, + }, + } + + local function on_attach(client, bufnr) + --[[ vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') ]] + if client.name == 'jdtls' or client.name == 'jdt.ls' then + -- client.server_capabilities.documentFormattingProvider = false + vim.lsp.codelens.refresh() + if JAVA_DAP_ACTIVE then + require('jdtls').setup_dap { hotcodereplace = 'auto' } + require('jdtls.setup').add_commands() + require('jdtls.dap').setup_dap_main_class_configs() + end + end + -- -- util.info(client.name .. " " .. (enable and "yes" or "no"), "format") + client.server_capabilities.documentFormattingProvider = true + -- client.server_capabilities.documentFormattingProvider = true + client.server_capabilities.semanticTokensProvider = nil + end + + require('mason-lspconfig').setup_handlers { + function(server_name) -- default handler (optional) + lspconfig[server_name].setup { + on_attach = on_attach, + capabilities = capabilities, + } + end, + ['clangd'] = function() + local clangd_flags = { + '-j=5', + '--all-scopes-completion', + '--suggest-missing-includes', + '--background-index', + '--pch-storage=disk', + '--cross-file-rename', + '--log=info', + '--completion-style=detailed', + '--enable-config', -- clangd 11+ supports reading from .clangd configuration file + '--clang-tidy', + -- "--clang-tidy-checks=-*,llvm-*,clang-analyzer-*,modernize-*,-modernize-use-trailing-return-type", + -- "--fallback-style=Google", + -- "--header-insertion=never", + -- "--query-driver=" + } + lspconfig.clangd.setup { + on_attach = on_attach, + capabilities = capabilities, + arg = { + unpack(clangd_flags) + } + } + end, + ['html'] = function() + lspconfig.html.setup { + on_attach = on_attach, + capabilities = capabilities, + filetypes = { "html", "jsp" }, + } + end, + ['lua_ls'] = function() + lspconfig.lua_ls.setup { + on_attach = on_attach, + capabilities = capabilities, + flags = { + debounce_text_changes = 150, + }, + settings = { + Lua = { + diagnostics = { + globals = { 'vim' }, + }, + -- workspace = { + -- library = { + -- [vim.fn.expand '$VIMRUNTIME/lua'] = true, + -- [vim.fn.stdpath 'config' .. '/lua'] = true, + -- }, + -- }, + telemetry = { + enable = false, + }, + }, + }, + } + end, + ['jdtls'] = function() + end, + ['rust_analyzer'] = function() + require('rust-tools').setup { + server = { + on_attach = on_attach, + standalone = false, + }, + } + end, + } + end + } +} diff --git a/lua/plugins/neogit.lua b/lua/plugins/neogit.lua new file mode 100644 index 0000000..50cd647 --- /dev/null +++ b/lua/plugins/neogit.lua @@ -0,0 +1,81 @@ +return { + 'NeogitOrg/neogit', + dependencies = 'sindrets/diffview.nvim', + cmd = 'Neogit', + opts = { + disable_signs = false, + disable_hint = false, + disable_context_highlighting = false, + disable_commit_confirmation = true, + -- Neogit refreshes its internal state after specific events, which can be expensive depending on the repository size. + -- Disabling `auto_refresh` will make it so you have to manually refresh the status after you open it. + auto_refresh = true, + disable_builtin_notifications = false, + use_magit_keybindings = false, + -- Change the default way of opening neogit + kind = 'tab', + -- The time after which an output console is shown for slow running commands + console_timeout = 2000, + -- Automatically show console if a command takes more than console_timeout milliseconds + auto_show_console = true, + -- Change the default way of opening the commit popup + commit_popup = { + kind = 'split', + }, + -- Change the default way of opening popups + popup = { + kind = 'split', + }, + status = { + recent_commit_count = 50, + }, + -- customize displayed signs + signs = { + -- { CLOSED, OPENED } + section = { '>', 'v' }, + item = { '>', 'v' }, + hunk = { '', '' }, + }, + integrations = { + -- Neogit only provides inline diffs. If you want a more traditional way to look at diffs, you can use `sindrets/diffview.nvim`. + -- The diffview integration enables the diff popup, which is a wrapper around `sindrets/diffview.nvim`. + -- + -- Requires you to have `sindrets/diffview.nvim` installed. + diffview = true, + }, + -- Setting any section to `false` will make the section not render at all + section = { + untracked = { + folded = false, + }, + unstaged = { + folded = false, + }, + staged = { + folded = false, + }, + stashes = { + folded = true, + }, + unpulled = { + folded = true, + }, + unmerged = { + folded = false, + }, + recent = { + folded = true, + }, + }, + -- override/add mappings + -- mappings = { + -- -- modify status buffer mappings + -- status = { + -- -- Adds a mapping with "B" as key that does the "BranchPopup" command + -- ['B'] = 'BranchPopup', + -- -- Removes the default mapping of "s" + -- -- ['s'] = '', + -- }, + -- }, + }, +} diff --git a/lua/plugins/oil.lua b/lua/plugins/oil.lua new file mode 100644 index 0000000..998efd2 --- /dev/null +++ b/lua/plugins/oil.lua @@ -0,0 +1,45 @@ +return { + 'stevearc/oil.nvim', + -- lazy = false, + event = 'VeryLazy', + opts = { + columns = { + "mtime", + "size", + "permissions", + "icon", + }, + -- Buffer-local options to use for oil buffers + buf_options = { + buflisted = false, + }, + -- Window-local options to use for oil buffers + win_options = { + wrap = false, + signcolumn = "no", + cursorcolumn = false, + foldcolumn = "0", + spell = false, + list = false, + conceallevel = 3, + concealcursor = 'nvic', + }, + keymaps = { + ['g?'] = 'actions.show_help', + [''] = 'actions.select', + [''] = 'actions.select_vsplit', + [''] = 'actions.select_split', + [''] = 'actions.preview', + [''] = 'actions.preview', + [''] = 'actions.close', + ['q'] = 'actions.close', + [''] = 'actions.refresh', + ['-'] = 'actions.parent', + ['l'] = 'actions.parent', + ['_'] = 'actions.open_cwd', + ['`'] = 'actions.cd', + ['~'] = 'actions.tcd', + ['g.'] = 'actions.toggle_hidden', + }, + }, +} diff --git a/lua/plugins/theme.lua b/lua/plugins/theme.lua new file mode 100644 index 0000000..25a3a87 --- /dev/null +++ b/lua/plugins/theme.lua @@ -0,0 +1,159 @@ +local l = false +return { + { + -- url = 'https://git.filnar.com/fiplox/neogruber.git', + dir = '~/dev/home/neogruber.nvim/', + lazy = false, + opts = { + transparent = true, + light = l, + } + -- event = 'VeryLazy' + }, + -- { + -- "Mofiqul/adwaita.nvim", + -- lazy = false, + -- priority = 1000, + -- -- configure and set on startup + -- config = function() + -- vim.g.adwaita_darker = false -- for darker version + -- vim.g.adwaita_disable_cursorline = false -- to disable cursorline + -- vim.g.adwaita_transparent = true -- makes the background transparent + -- -- vim.cmd('colorscheme adwaita') + -- end + -- }, + { + 'freddiehaddad/feline.nvim', + dependencies = { + 'nvim-tree/nvim-web-devicons', + }, + config = function() + local feline = require 'feline' + local utils = require 'config.utils' + local c = utils.feline_c + local theme + if l then + theme = utils.feline_theme_light + else + theme = utils.feline_theme_dark + end + local vi_mode_colors = utils.feline_vi_mode_colors + + local left = { + c.vim_mode, + -- c.gitBranch, + -- c.gitDiffAdded, + -- c.gitDiffRemoved, + -- c.gitDiffChanged, + c.file_info, + c.right_separator, + c.lsp_client_names, + c.diagnostic_errors, + c.diagnostic_warnings, + c.diagnostic_info, + c.diagnostic_hints, + } + + -- local middle = { + -- c.separator, + -- } + + local right = { + c.file_type, + c.search_count, + c.macro, + c.file_encoding, + -- c.startup, + c.line_percentage, + c.select_count, + c.position, + } + + local components = { + active = { + left, + -- middle, + right, + }, + inactive = { + left, + -- middle, + right, + }, + } + + feline.setup { + components = components, + theme = theme, + vi_mode_colors = vi_mode_colors, + } + end, + }, + -- { + -- 'nvim-lualine/lualine.nvim', + -- dependencies = { 'nvim-tree/nvim-web-devicons', 'nvim-lua/lsp-status.nvim' }, + -- opts = { + -- options = { + -- theme = "adwaita" + -- }, + -- sections = { + -- lualine_a = { 'mode' }, + -- lualine_b = { 'branch', 'diff', 'diagnostics' }, + -- lualine_c = { 'filename', "require'lsp-status'.status()" }, + -- lualine_x = { 'encoding', 'fileformat', 'filetype' }, + -- lualine_y = { 'progress' }, + -- lualine_z = { 'location' } + -- }, + -- inactive_sections = { + -- lualine_a = {}, + -- lualine_b = {}, + -- lualine_c = { 'filename', "require'lsp-status'.status()" }, + -- lualine_x = { 'location' }, + -- lualine_y = {}, + -- lualine_z = {} + -- }, + -- tabline = {}, + -- winbar = {}, + -- inactive_winbar = {}, + -- extensions = {} + -- }, + -- }, + -- { + -- 'nvimdev/dashboard-nvim', + -- event = 'VimEnter', + -- opts = { + -- -- theme = 'doom', + -- theme = 'hyper', + -- shortcut_type = 'number', + -- config = { + -- shortcut = { + -- -- action can be a function type + -- { + -- desc = "Files", + -- group = '', + -- key = 'f', + -- action = 'edit .' + -- }, + -- }, + -- packages = { enable = false }, -- show how many plugins neovim loaded + -- -- limit how many projects list, action when you press key or enter it will run this action. + -- -- action can be a functino type, e.g. + -- -- action = func(path) vim.cmd('Telescope find_files cwd=' .. path) end + -- project = { + -- enable = true, + -- limit = 8, + -- -- icon = ' ', + -- label = '', + -- action = 'edit' + -- }, + -- mru = { + -- limit = 10, + -- -- icon = 'your icon', + -- label = '', + -- }, + -- footer = {}, -- footer + -- } + -- }, + -- dependencies = { { 'nvim-tree/nvim-web-devicons' } } + -- }, +} diff --git a/lua/plugins/toggleterm.lua b/lua/plugins/toggleterm.lua new file mode 100644 index 0000000..a0b21df --- /dev/null +++ b/lua/plugins/toggleterm.lua @@ -0,0 +1,41 @@ +return { + 'akinsho/toggleterm.nvim', + cmd = 'ToggleTerm', + opts = { + -- size can be a number or function which is passed the current terminal + -- size = function(term) + -- if term.direction == 'horizontal' then + -- return 15 + -- elseif term.direction == 'vertical' then + -- return vim.o.columns * 0.4 + -- end + -- end, + shade_filetypes = { 'none', 'fzf' }, + -- open_mapping = [[]], + hide_numbers = true, -- hide the number column in toggleterm buffers + shade_terminals = true, + shading_factor = '2', -- the degree by which to darken to terminal colour, default: 1 for dark backgrounds, 3 for light + start_in_insert = true, + insert_mappings = true, -- whether or not the open mapping applies in insert mode + persist_size = true, + -- direction = 'horizontal', -- 'vertical' | 'horizontal' | 'window' | 'float', + direction = 'float', -- 'vertical' | 'horizontal' | 'window' | 'float', + close_on_exit = true, -- close the terminal window when the process exits + shell = vim.o.shell, -- change the default shell + -- This field is only relevant if direction is set to 'float' + float_opts = { + -- The border key is *almost* the same as 'nvim_win_open' + -- see :h nvim_win_open for details on borders however + -- the 'curved' border is a custom border type + -- not natively supported but implemented in this plugin. + border = 'curved', -- | 'double' | 'shadow' | 'curved' --| ... other options supported by win open + -- width = 100, + -- height = 30, + -- winblend = 20, + -- highlights = { + -- border = 'Normal', + -- background = 'Normal', + -- }, + }, + }, +} diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua new file mode 100644 index 0000000..dabc361 --- /dev/null +++ b/lua/plugins/treesitter.lua @@ -0,0 +1,34 @@ +return { + 'nvim-treesitter/nvim-treesitter', + -- lazy = false, + -- dependencies = { 'nvim-treesitter/playground' }, + -- dependencies = 'windwp/nvim-ts-autotag', + event = 'VeryLazy', + init = function(plugin) + require("lazy.core.loader").add_to_rtp(plugin) + require("nvim-treesitter.query_predicates") + end, + config = function() + require('nvim-treesitter.parsers').get_parser_configs().asm = { + install_info = { + url = 'https://github.com/rush-rs/tree-sitter-asm.git', + files = { 'src/parser.c' }, + branch = 'main', + }, + } + local configs = require 'nvim-treesitter.configs' + + configs.setup { + ignore_install = { 'haskell' }, + highlight = { + enable = true, -- false will disable the whole extension + disable = { 'html' }, + }, + -- context_commentstring = { enable = true, config = { css = '// %s' } }, + -- indent = {enable = true, disable = {"python", "html", "javascript"}}, + -- TODO seems to be broken + indent = { enable = true, disable = { 'python', 'css' } }, + -- autotag = { enable = true }, + } + end, +} diff --git a/lua/plugins/trouble.lua b/lua/plugins/trouble.lua index af5f4c5..1e2727f 100644 --- a/lua/plugins/trouble.lua +++ b/lua/plugins/trouble.lua @@ -4,43 +4,44 @@ return { dependencies = { "nvim-tree/nvim-web-devicons" }, opts = { position = "bottom", -- position of the list can be: bottom, top, left, right - height = 10, -- height of the trouble list when position is top or bottom - width = 50, -- width of the list when position is left or right - icons = true, -- use devicons for filenames + height = 10, -- height of the trouble list when position is top or bottom + width = 50, -- width of the list when position is left or right + icons = true, -- use devicons for filenames mode = "workspace_diagnostics", -- "workspace_diagnostics", "document_diagnostics", "quickfix", "lsp_references", "loclist" - severity = nil, -- nil (ALL) or vim.diagnostic.severity.ERROR | WARN | INFO | HINT + severity = nil, -- nil (ALL) or vim.diagnostic.severity.ERROR | WARN | INFO | HINT fold_open = "", -- icon used for open folds fold_closed = "", -- icon used for closed folds - group = true, -- group results by file - padding = true, -- add an extra new line on top of the list - action_keys = { -- key mappings for actions in the trouble list + group = true, -- group results by file + padding = true, -- add an extra new line on top of the list + action_keys = { -- key mappings for actions in the trouble list -- map to {} to remove a mapping, for example: -- close = {}, - close = "q", -- close the list - cancel = "", -- cancel the preview and get back to your last window / buffer / cursor - refresh = "r", -- manually refresh - jump = { "o", "" }, -- jump to the diagnostic or open / close folds - open_split = { "" }, -- open buffer in new split - open_vsplit = { "" }, -- open buffer in new vsplit - open_tab = { "" }, -- open buffer in new tab - jump_close = { "" }, -- jump to the diagnostic and close the list - toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode - switch_severity = "s", -- switch "diagnostics" severity filter level to HINT / INFO / WARN / ERROR - toggle_preview = "P", -- toggle auto_preview - hover = "K", -- opens a small popup with the full multiline message - preview = "p", -- preview the diagnostic location - close_folds = { "zM", "zm" }, -- close all folds - open_folds = { "zR", "zr" }, -- open all folds - toggle_fold = { "zA", "za" }, -- toggle fold of current file - previous = "k", -- previous item - next = "j" -- next item + close = "q", -- close the list + cancel = "", -- cancel the preview and get back to your last window / buffer / cursor + refresh = "r", -- manually refresh + jump = { "o", "" }, -- jump to the diagnostic or open / close folds + open_split = { "" }, -- open buffer in new split + open_vsplit = { "" }, -- open buffer in new vsplit + open_tab = { "" }, -- open buffer in new tab + jump_close = { "" }, -- jump to the diagnostic and close the list + toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode + switch_severity = "s", -- switch "diagnostics" severity filter level to HINT / INFO / WARN / ERROR + toggle_preview = "P", -- toggle auto_preview + hover = "K", -- opens a small popup with the full multiline message + preview = "p", -- preview the diagnostic location + close_folds = { "zM", "zm" }, -- close all folds + open_folds = { "zR", "zr" }, -- open all folds + toggle_fold = { "zA", "za" }, -- toggle fold of current file + previous = "k", -- previous item + next = "j" -- next item }, - indent_lines = true, -- add an indent guide below the fold icons - auto_open = false, -- automatically open the list when you have diagnostics - auto_close = true, -- automatically close the list when you have no diagnostics - auto_preview = false, -- automatically preview the location of the diagnostic. to close preview and go back to last window - auto_fold = false, -- automatically fold a file trouble list at creation - auto_jump = { "lsp_definitions" }, -- for the given modes, automatically jump if there is only a single result + indent_lines = true, -- add an indent guide below the fold icons + auto_open = false, -- automatically open the list when you have diagnostics + auto_close = true, -- automatically close the list when you have no diagnostics + auto_preview = false, -- automatically preview the location of the diagnostic. to close preview and go back to last window + auto_fold = false, -- automatically fold a file trouble list at creation + auto_jump = { "lsp_definitions" }, -- for the given modes, automatically jump if there is only a single result + include_declaration = { "lsp_references", "lsp_implementations", "lsp_definitions" }, -- for the given modes, include the declaration of the current symbol in the results signs = { -- icons / text used for a diagnostic error = "", diff --git a/lua/plugins/wildcat.lua b/lua/plugins/wildcat.lua new file mode 100644 index 0000000..900f6d0 --- /dev/null +++ b/lua/plugins/wildcat.lua @@ -0,0 +1,13 @@ +return { + 'javiorfo/nvim-wildcat', + lazy = true, + cmd = { "WildcatRun" }, + dependencies = { 'javiorfo/nvim-popcorn' }, + opts = { + tomcat = { + home = "/home/fiplox/Software/apache-tomcat-10.1.13/", + app_base = "webapps", + default = true + } + } +} diff --git a/spell/fr.utf-8.add b/spell/fr.utf-8.add new file mode 100644 index 0000000..d12239e --- /dev/null +++ b/spell/fr.utf-8.add @@ -0,0 +1,2 @@ +#synchronisme/! +Asynchronisme/! diff --git a/spell/fr.utf-8.add.spl b/spell/fr.utf-8.add.spl new file mode 100644 index 0000000..bfc5ccc Binary files /dev/null and b/spell/fr.utf-8.add.spl differ