diff options
author | Luca Matei Pintilie <lucafulger@gmail.com> | 2023-03-29 17:52:56 +0000 |
---|---|---|
committer | Luca Matei Pintilie <lucafulger@gmail.com> | 2023-03-29 17:52:56 +0000 |
commit | e4588098e2c76fac277f3598c8d0e2c60722f1ab (patch) | |
tree | ec6430ed7de717fdce58493eef9bffabb2ed721a | |
parent | f8f6e1566e539b42d70380c02ea18a61fa4f41e9 (diff) | |
download | dotfiles-e4588098e2c76fac277f3598c8d0e2c60722f1ab.tar dotfiles-e4588098e2c76fac277f3598c8d0e2c60722f1ab.tar.gz dotfiles-e4588098e2c76fac277f3598c8d0e2c60722f1ab.tar.bz2 dotfiles-e4588098e2c76fac277f3598c8d0e2c60722f1ab.tar.lz dotfiles-e4588098e2c76fac277f3598c8d0e2c60722f1ab.tar.xz dotfiles-e4588098e2c76fac277f3598c8d0e2c60722f1ab.tar.zst dotfiles-e4588098e2c76fac277f3598c8d0e2c60722f1ab.zip |
Add marks and colorcolumn 120
-rw-r--r-- | .config/nvim/lua/filetree.lua | 6 | ||||
-rw-r--r-- | .config/nvim/lua/general.lua | 10 | ||||
-rw-r--r-- | .config/nvim/lua/lsp.lua | 63 | ||||
-rw-r--r-- | .config/nvim/lua/plugins.lua | 50 |
4 files changed, 71 insertions, 58 deletions
diff --git a/.config/nvim/lua/filetree.lua b/.config/nvim/lua/filetree.lua index c47cbca..581c0bb 100644 --- a/.config/nvim/lua/filetree.lua +++ b/.config/nvim/lua/filetree.lua @@ -1,6 +1,2 @@ -require("nvim-tree").setup({ - view = { - side = "right"; - } -}) +require("nvim-tree").setup({ view = { side = "right" } }) diff --git a/.config/nvim/lua/general.lua b/.config/nvim/lua/general.lua index f50f538..4d02f1d 100644 --- a/.config/nvim/lua/general.lua +++ b/.config/nvim/lua/general.lua @@ -8,7 +8,7 @@ vim.opt.undofile = true vim.opt.backupcopy = "yes" vim.opt.undolevels = 1000 vim.opt.wrap = false -vim.opt.colorcolumn = "80" +vim.opt.colorcolumn = "120" vim.opt.scrolloff = 5 -- vim.opt.tabstop = 4 @@ -56,12 +56,12 @@ if vim.fn.has("wsl") == 1 then callback = function() vim.fn.system("clip.exe", vim.fn.getreg("\"")) end; }) else - vim.api.nvim_create_autocmd('TextYankPost', { + vim.api.nvim_create_autocmd("TextYankPost", { callback = function() - if vim.v.event.operator == 'y' and vim.v.event.regname == '+' then - require('osc52').copy_register('+') + if vim.v.event.operator == "y" and vim.v.event.regname == "+" then + require("osc52").copy_register("+") end - end + end; }) end diff --git a/.config/nvim/lua/lsp.lua b/.config/nvim/lua/lsp.lua index 4c8ab62..495f7fa 100644 --- a/.config/nvim/lua/lsp.lua +++ b/.config/nvim/lua/lsp.lua @@ -105,9 +105,10 @@ vim.api.nvim_create_autocmd("LspAttach", { end; }) -local lsputils = require("lspconfig").util +local lspconfig = require("lspconfig") +local lsputils = lspconfig.util -require("lspconfig").tsserver.setup({ +lspconfig.tsserver.setup({ on_attach = on_attach; root_dir = lsputils.root_pattern("package.json", "tsconfig.json"); settings = { @@ -157,12 +158,12 @@ require("lspconfig").tsserver.setup({ -- }; -- }); -require("lspconfig").rust_analyzer.setup({ +lspconfig.rust_analyzer.setup({ capabilities = capabilities; on_attach = on_attach; }) -require("lspconfig").sqls.setup({ +lspconfig.sqls.setup({ on_attach = function(client, bufnr) require("sqls").on_attach(client, bufnr) on_attach(client, bufnr) @@ -170,7 +171,7 @@ require("lspconfig").sqls.setup({ capabilities = capabilities; }) -require("lspconfig").omnisharp.setup({ +lspconfig.omnisharp.setup({ cmd = { "omnisharp" }; handlers = { @@ -215,50 +216,35 @@ require("lspconfig").omnisharp.setup({ analyze_open_documents_only = false; }) -require("lspconfig").marksman.setup({ +lspconfig.marksman.setup({ root_dir = vim.loop.cwd; on_attach = on_attach; capabilities = capabilities; }) -require("lspconfig").jsonls.setup({ +lspconfig.jsonls.setup({ capabilities = capabilities; cmd = { "vscode-json-language-server"; "--stdio" }; on_attach = on_attach; }) -require("lspconfig").html.setup({ +lspconfig.html.setup({ capabilities = capabilities; cmd = { "vscode-html-language-server"; "--stdio" }; on_attach = on_attach; }) -require("lspconfig").cssls.setup({ - capabilities = capabilities; - on_attach = on_attach; -}) +lspconfig.cssls.setup({ capabilities = capabilities; on_attach = on_attach }) -require("lspconfig").bashls.setup({ - capabilities = capabilities; - on_attach = on_attach; -}) +lspconfig.bashls.setup({ capabilities = capabilities; on_attach = on_attach }) -require("lspconfig").clangd.setup({ - capabilities = capabilities; - on_attach = on_attach; -}) +lspconfig.clangd.setup({ capabilities = capabilities; on_attach = on_attach }) -require("lspconfig").dockerls.setup({ - capabilities = capabilities; - on_attach = on_attach; -}) +lspconfig.dockerls.setup({ capabilities = capabilities; on_attach = on_attach }) -require("lspconfig").eslint.setup({ - capabilities = capabilities; - on_attach = on_attach; -}) +lspconfig.eslint.setup({ capabilities = capabilities; on_attach = on_attach }) -require("lspconfig").lua_ls.setup({ +lspconfig.lua_ls.setup({ capabilities = capabilities; on_attach = on_attach; settings = { @@ -281,9 +267,9 @@ require("lspconfig").lua_ls.setup({ }; }) -require("lspconfig").jdtls.setup({}) +lspconfig.jdtls.setup({}) -require('lspconfig').jedi_language_server.setup({}) +lspconfig.jedi_language_server.setup({}) local null_ls = require("null-ls") @@ -313,16 +299,11 @@ null_ls.setup({ local dap, dapui = require("dap"), require("dapui") dapui.setup() -dap.listeners.after.event_initialized["dapui_config"] = function() - dapui.open() -end -dap.listeners.before.event_terminated["dapui_config"] = function() - dapui.close() -end -dap.listeners.before.event_exited["dapui_config"] = function() - dapui.close() -end - +dap.listeners.after.event_initialized["dapui_config"] = + function() dapui.open() end +dap.listeners.before.event_terminated["dapui_config"] = + function() dapui.close() end +dap.listeners.before.event_exited["dapui_config"] = function() dapui.close() end vim.diagnostic.config({ virtual_text = false; diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua index 101eaa5..d261628 100644 --- a/.config/nvim/lua/plugins.lua +++ b/.config/nvim/lua/plugins.lua @@ -5,6 +5,7 @@ local PKGS = { -- Common { url = "https://github.com/kyazdani42/nvim-web-devicons.git" }; { url = "https://github.com/ojroques/nvim-osc52.git" }; + { url = "https://github.com/chentoast/marks.nvim.git" }; { url = "https://github.com/kyazdani42/nvim-tree.lua.git" }; { url = "https://github.com/nvim-telescope/telescope.nvim.git" }; @@ -150,9 +151,9 @@ local function init_plugins() }); require("catppuccin").setup({ - transparent_background = true, - show_end_of_line = true, - term_colors = true, + transparent_background = true; + show_end_of_line = true; + term_colors = true; }) vim.o.foldcolumn = "1" @@ -160,10 +161,10 @@ local function init_plugins() vim.o.foldlevelstart = 99 vim.o.foldenable = true - require('osc52').setup { - max_length = 0, -- Maximum length of selection (0 for no limit) - silent = false, -- Disable message on successful copy - trim = false, -- Trim surrounding whitespaces before copy + require("osc52").setup { + max_length = 0; -- Maximum length of selection (0 for no limit) + silent = false; -- Disable message on successful copy + trim = false; -- Trim surrounding whitespaces before copy } require("devcontainer").setup({}) @@ -246,6 +247,41 @@ local function init_plugins() yadm = { enable = false }; } + require("marks").setup({ + -- whether to map keybinds or not. default true + default_mappings = false; + -- which builtin marks to show. default {} + builtin_marks = { "."; "<"; ">"; "^" }; + -- whether movements cycle back to the beginning/end of buffer. default true + cyclic = true; + -- whether the shada file is updated after modifying uppercase marks. default false + force_write_shada = false; + -- how often (in ms) to redraw signs/recompute mark positions. + -- higher values will have better performance but may cause visual lag, + -- while lower values may cause performance penalties. default 150. + refresh_interval = 250; + -- sign priorities for each type of mark - builtin marks, uppercase marks, lowercase + -- marks, and bookmarks. + -- can be either a table with all/none of the keys, or a single number, in which case + -- the priority applies to all marks. + -- default 10. + sign_priority = { lower = 10; upper = 15; builtin = 8; bookmark = 20 }; + -- disables mark tracking for specific filetypes. default {} + excluded_filetypes = {}; + -- marks.nvim allows you to configure up to 10 bookmark groups, each with its own + -- sign/virttext. Bookmarks can be used to group together positions and quickly move + -- across multiple buffers. default sign is '!@#$%^&*()' (from 0 to 9), and + -- default virt_text is "". + -- bookmark_0 = { + -- sign = "⚑", + -- virt_text = "hello world", + -- -- explicitly prompt for a virtual line annotation when setting a bookmark from this group. + -- -- defaults to false. + -- annotate = false, + -- }, + mappings = {}; + }) + end return { |