diff --git a/init.lua b/init.lua index 8c82dca..ba4f6a8 100644 --- a/init.lua +++ b/init.lua @@ -6,6 +6,11 @@ for k, v in pairs(options.vim) do vim.opt[k] = v end +-- set global vim options +for k, v in pairs(options.g) do + vim.g[k] = v +end + require("bootstrap") -- apply color theme diff --git a/lua/options.lua b/lua/options.lua index ef2b2a2..eabf7cb 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -1,22 +1,28 @@ return { + -- global vim options + g = { + -- disable netrw + loaded_netrw = 1, + loaded_netrwPlugin = 1 + }, vim = { - swapfile = false, -- disable swap files cuz they are garbage + swapfile = false, -- disable swap files cuz they are garbage clipboard = "unnamedplus", -- Sync with system clipboard - expandtab = true, -- spaces instead of tabs - shiftwidth = 4, -- tab width in spaces - tabstop = 4, -- Number of spaces tabs count for + expandtab = true, -- spaces instead of tabs + shiftwidth = 4, -- tab width in spaces + tabstop = 4, -- Number of spaces tabs count for completeopt = "menu,menuone,noselect", - confirm = true, -- Confirm to save changes before exiting modified buffer - cursorline = true, -- Enable highlighting of the current line - ignorecase = true, -- Ignore case - mouse = "a", -- Enable mouse mode - number = true, -- Print line number - pumblend = 0, -- Popup pseudo transparency - pumheight = 12, -- Popup height - showmode = false, -- Dont show mode since we have a statusline - smartindent = true, -- Insert indents automatically - termguicolors = true, -- True color support - virtualedit = "block", -- Allow cursor to move where there is no text in visual block mode + confirm = true, -- Confirm to save changes before exiting modified buffer + cursorline = true, -- Enable highlighting of the current line + ignorecase = true, -- Ignore case + mouse = "a", -- Enable mouse mode + number = true, -- Print line number + pumblend = 0, -- Popup pseudo transparency + pumheight = 12, -- Popup height + showmode = false, -- Dont show mode since we have a statusline + smartindent = true, -- Insert indents automatically + termguicolors = true, -- True color support + virtualedit = "block", -- Allow cursor to move where there is no text in visual block mode wrap = false, foldcolumn = "1", foldlevel = 99, @@ -57,7 +63,8 @@ return { }, }, git = { - icons = { + -- symbols used by gitsigns + signs = { add = "│", change = "¦", delete = "", @@ -65,6 +72,11 @@ return { changedelete = "¦", untracked = "│", }, + icons = { + add = "+", + change = "~", + delete = "-", + }, }, lazy = { install_missing = true, diff --git a/lua/plugins/barbar.lua b/lua/plugins/barbar.lua index dd62135..a4015e9 100644 --- a/lua/plugins/barbar.lua +++ b/lua/plugins/barbar.lua @@ -1,6 +1,10 @@ return { { "romgrk/barbar.nvim", + dependencies = { + 'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status + 'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons + }, init = function() vim.g.barbar_auto_setup = false end, @@ -29,6 +33,11 @@ return { [vim.diagnostic.severity.HINT] = { enabled = true }, icon = options.lsp.icons.Hint, }, + gitsigns = { + added = { enabled = true, icon = options.git.icons.add }, + changed = { enabled = true, icon = options.git.icons.change }, + deleted = { enabled = true, icon = options.git.icons.deleted }, + }, }, } end, diff --git a/lua/plugins/coq.lua b/lua/plugins/coq.lua deleted file mode 100644 index 1076400..0000000 --- a/lua/plugins/coq.lua +++ /dev/null @@ -1,46 +0,0 @@ -return { - { - "ms-jpq/coq_nvim", - branch = 'coq', - build = function(_) - vim.cmd("COQdeps") - end, - config = function(_, _) - vim.cmd("COQnow -s") - end, - init = function(_) - vim.g.coq_settings = { - display = { - ghost_text = { - enabled = true, - context = { "", "" }, - highlight_group = "NonText" - }, - pum = { - fast_close = false, - kind_context = { " ", " " }, - source_context = { "", " " }, - }, - icons = { - spacing = 1, - mode = "short" - }, - preview = { - border = "single", - x_max_len = 25, - } - } - } - end, - dependencies = { - { - 'ms-jpq/coq.artifacts', - branch = "artifacts" - }, - { - "ms-jpq/coq.thirdparty", - branch = "3p" - } - } - } -} diff --git a/lua/plugins/diffview.lua b/lua/plugins/diffview.lua index eff27b4..dc80d82 100644 --- a/lua/plugins/diffview.lua +++ b/lua/plugins/diffview.lua @@ -1,29 +1,5 @@ return { { "sindrets/diffview.nvim", - opts = { - keymaps = { - file_panel = { - { - "n", "cc", - "Git commit wincmd J", - { desc = "Commit staged changes" }, - }, - { - "n", "ca", - "Git commit --amend wincmd J", - { desc = "Amend the last commit" }, - }, - { - "n", "c", - ":Git commit ", - { desc = "Populate command line with \":Git commit \"" }, - }, - }, - } - } - }, - { - "tpope/vim-fugitive" } } diff --git a/lua/plugins/dressing.lua b/lua/plugins/dressing.lua index ad0f237..5b710c9 100644 --- a/lua/plugins/dressing.lua +++ b/lua/plugins/dressing.lua @@ -1,5 +1,22 @@ return { { "stevearc/dressing.nvim", + opts = function() + local options = require('options') + return { + input = { + title_pos = "center", + border = options.ui.border, + relative = 'editor', + win_options = { + winhighlight = + 'NormalFloat:Normal,FloatTitle:TelescopePromptBorder,FloatBorder:TelescopePromptBorder' + } + }, + select = { + backend = { "telescope" } + } + } + end }, } diff --git a/lua/plugins/dropbar.lua b/lua/plugins/dropbar.lua new file mode 100644 index 0000000..310d00d --- /dev/null +++ b/lua/plugins/dropbar.lua @@ -0,0 +1,24 @@ +return { + { + 'Bekaboo/dropbar.nvim', + -- optional, but required for fuzzy finder support + dependencies = { + 'nvim-telescope/telescope-fzf-native.nvim' + }, + opts = { + ui = { + bar = { + separator = ' ', + extends = '…', + }, + menu = { + separator = ' ', + indicator = ' ', + }, + }, + menu = { + preview = false + } + } + } +} diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua index 08c1048..95fa9f8 100644 --- a/lua/plugins/gitsigns.lua +++ b/lua/plugins/gitsigns.lua @@ -5,16 +5,16 @@ return { local options = require("options") return { signs = { - add = { text = options.git.icons.add }, - change = { text = options.git.icons.change }, - delete = { text = options.git.icons.delete }, - topdelete = { text = options.git.icons.topdelete }, - changedelete = { text = options.git.icons.changedelete }, - untracked = { text = options.git.icons.untracked }, + add = { text = options.git.signs.add }, + change = { text = options.git.signs.change }, + delete = { text = options.git.signs.delete }, + topdelete = { text = options.git.signs.topdelete }, + changedelete = { text = options.git.signs.changedelete }, + untracked = { text = options.git.signs.untracked }, }, signcolumn = true, preview_config = { - border = "rounded", + border = options.ui.border, }, } end, diff --git a/lua/plugins/lightbulb.lua b/lua/plugins/lightbulb.lua deleted file mode 100644 index abe1285..0000000 --- a/lua/plugins/lightbulb.lua +++ /dev/null @@ -1,25 +0,0 @@ -return { - { - "kosayoda/nvim-lightbulb", - opts = { - autocmd = { enabled = true }, - sign = { - enabled = false, - }, - float = { - enabled = true, - -- Text to show in the floating window. - text = "💡", - -- Highlight group to highlight the floating window. - hl = "LightBulbFloatWin", - -- Window options. - -- See |vim.lsp.util.open_floating_preview| and |nvim_open_win|. - -- Note that some options may be overridden by |open_floating_preview|. - win_opts = { - focusable = true, - border = "none", - }, - }, - }, - }, -} diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 17356c2..b7db171 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -31,22 +31,17 @@ return { require("mason").setup() - local coq = require('coq') local handlers = { -- The first entry (without a key) will be the default handler -- and will be called for each installed server that doesn't have -- a dedicated handler. function(server_name) -- default handler (optional) - require("lspconfig")[server_name].setup(coq.lsp_ensure_capabilities({ + require("lspconfig")[server_name].setup({ on_attach = function(client, bufnr) -- setup lsp-format require("lsp-format").on_attach(client, bufnr) - -- setup navic - if client.server_capabilities["documentSymbolProvider"] then - require("nvim-navic").attach(client, bufnr) - end end - })) + }) end, } @@ -65,5 +60,13 @@ return { }, { 'lukas-reineke/lsp-format.nvim', + }, + { + "jinzhongjia/LspUI.nvim", + branch = "main", + config = function() + require("LspUI").setup({ + }) + end } } diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index fd8e3f4..4afcdbb 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -31,18 +31,6 @@ return { }, }, lualine_b = { - { - "filename", - color = "lualine_b_terminal", - symbols = { - modified = "", -- Text to show when the file is modified. - readonly = "", -- Text to show when the file is non-modifiable or readonly. - unnamed = "", -- Text to show for unnamed buffers. - newfile = "[New]", -- Text to show for newly created file before first write - }, - }, - }, - lualine_c = { { function() return '  ' @@ -75,6 +63,18 @@ return { vim.cmd("Mason") end, 100) end + } + }, + lualine_c = { + { + "filename", + path = 4, + symbols = { + modified = "", -- Text to show when the file is modified. + readonly = "", -- Text to show when the file is non-modifiable or readonly. + unnamed = "", -- Text to show for unnamed buffers. + newfile = "[New]", -- Text to show for newly created file before first write + }, }, { "branch", diff --git a/lua/plugins/mini.lua b/lua/plugins/mini.lua index 639ba60..c38ddb1 100644 --- a/lua/plugins/mini.lua +++ b/lua/plugins/mini.lua @@ -36,5 +36,5 @@ return { line_up = "", }, }, - }, + } } diff --git a/lua/plugins/navic.lua b/lua/plugins/navic.lua deleted file mode 100644 index 77575f1..0000000 --- a/lua/plugins/navic.lua +++ /dev/null @@ -1,61 +0,0 @@ -return { - { - "SmiteshP/nvim-navic", - dependencies = { - "neovim/nvim-lspconfig", - }, - opts = { - depth_limit_indicator = "...", - depth_limit = 8, - click = true, - }, - }, - { - "utilyre/barbecue.nvim", - name = "barbecue", - version = "*", - dependencies = { - "SmiteshP/nvim-navic", - "nvim-tree/nvim-web-devicons", - }, - opts = { - attach_navic = false, - symbols = { - ---Modification indicator. - modified = "●", - ---Truncation indicator. - ellipsis = "...", - ---Entry separator. - separator = "", - }, - kinds = { - File = "󰈙", - Module = "", - Namespace = "󰌗", - Package = "", - Class = "󰌗", - Method = "󰆧", - Property = "", - Field = "", - Constructor = "", - Enum = "󰕘", - Interface = "󰕘", - Function = "󰊕", - Variable = "󰆧", - Constant = "󰏿", - String = "󰀬", - Number = "󰎠", - Boolean = "◩", - Array = "󰅪", - Object = "󰅩", - Key = "󰌋", - Null = "󰟢", - EnumMember = "", - Struct = "󰌗", - Event = "", - Operator = "󰆕", - TypeParameter = "󰊄", - }, - }, - }, -} diff --git a/lua/plugins/neogit.lua b/lua/plugins/neogit.lua deleted file mode 100644 index 51d22c9..0000000 --- a/lua/plugins/neogit.lua +++ /dev/null @@ -1,15 +0,0 @@ -return { - { - "NeogitOrg/neogit", - dependencies = { - "nvim-lua/plenary.nvim", -- required - "sindrets/diffview.nvim", -- optional - Diff integration - - -- Only one of these is needed, not both. - "nvim-telescope/telescope.nvim", -- optional - "ibhagwan/fzf-lua", -- optional - }, - config = true - } - -} diff --git a/lua/plugins/satellite.lua b/lua/plugins/satellite.lua new file mode 100644 index 0000000..460c235 --- /dev/null +++ b/lua/plugins/satellite.lua @@ -0,0 +1,11 @@ +return { + { + "lewis6991/satellite.nvim", + opts = { + + }, + config = function(opts, _) + require('satellite').setup(opts) + end + } +} diff --git a/lua/plugins/statuscol.lua b/lua/plugins/statuscol.lua index 08d01f5..208c01b 100644 --- a/lua/plugins/statuscol.lua +++ b/lua/plugins/statuscol.lua @@ -1,7 +1,11 @@ return { { "luukvbaal/statuscol.nvim", - priority = 1000, + lazy = true, + event = { + "BufEnter", + "LspAttach" + }, config = function() local builtin = require("statuscol.builtin") require("statuscol").setup({ @@ -14,31 +18,30 @@ return { "NvimTree", }, segments = { + -- folds + { + text = { builtin.foldfunc }, + click = "v:lua.ScFa", + }, -- diagnostic signs { sign = { - name = { "Diagnostic" }, + namespace = { "Diagnostic" }, colwidth = 2, - maxwidth = 1, }, auto = true, click = "v:lua.ScSa", }, -- line numbers { - text = { builtin.lnumfunc, " " }, + text = { builtin.lnumfunc }, click = "v:lua.ScLa", }, - -- folds - { - text = { builtin.foldfunc }, - click = "v:lua.ScFa", - }, -- git signs { - sign = { namespace = { "gitsigns" } }, + sign = { namespace = { "gitsigns" }, maxwidth = 1, }, click = "v:lua.ScSa", - }, + } }, }) end, diff --git a/lua/plugins/term.lua b/lua/plugins/term.lua index e3beb3a..1a37d1c 100644 --- a/lua/plugins/term.lua +++ b/lua/plugins/term.lua @@ -9,6 +9,7 @@ return { border = "single", winblend = 0 }, + persist_mode = true, start_in_insert = true, } }