chore(nvim): small tweaks, documentation

This commit is contained in:
2023-09-08 00:39:10 +03:00
parent 2f917c9285
commit 446d8971e7
11 changed files with 244 additions and 182 deletions

View File

@@ -9,12 +9,12 @@ vim.g.maplocalleader = " "
-- Set 'Space' as <NOP> key to leadermap key -- Set 'Space' as <NOP> key to leadermap key
key("n", "<Space>", "<NOP>", remap) key("n", "<Space>", "<NOP>", remap)
-- Filetype specialties.
require("filetype")
-- Global, windows options of neovim: -- Global, windows options of neovim:
require("options") require("options")
-- Filetype specialties.
require("filetype")
-- To adminstrate packages: -- To adminstrate packages:
require("plugin-manager") require("plugin-manager")

View File

@@ -29,3 +29,118 @@ local autoCommands = {
} }
M.nvim_create_augroups(autoCommands) M.nvim_create_augroups(autoCommands)
vim.api.nvim_create_autocmd("FileType", {
pattern = {
"help",
"alpha",
"dashboard",
"neo-tree",
"Trouble",
"lazy",
"mason",
"notify",
"toggleterm",
"lazyterm",
},
callback = function(event)
vim.b[event.buf].miniindentscope_disable = true
end,
})
-- ╭──────────────────────────────────────────────────────────╮
-- │ taken from LazyVim repository │
-- ╭─────────────────────────────────────────────────────────────────────────────╮
-- │ https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua│
-- ╰─────────────────────────────────────────────────────────────────────────────╯
local function augroup(name)
return vim.api.nvim_create_augroup("ivuorinen_" .. name, { clear = true })
end
-- Check if we need to reload the file when it changed
vim.api.nvim_create_autocmd({ "FocusGained", "TermClose", "TermLeave" }, {
group = augroup("checktime"),
command = "checktime",
})
-- Highlight on yank
vim.api.nvim_create_autocmd("TextYankPost", {
group = augroup("highlight_yank"),
callback = function()
vim.highlight.on_yank()
end,
})
-- resize splits if window got resized
vim.api.nvim_create_autocmd({ "VimResized" }, {
group = augroup("resize_splits"),
callback = function()
local current_tab = vim.fn.tabpagenr()
vim.cmd("tabdo wincmd =")
vim.cmd("tabnext " .. current_tab)
end,
})
-- go to last loc when opening a buffer
vim.api.nvim_create_autocmd("BufReadPost", {
group = augroup("last_loc"),
callback = function()
local exclude = { "gitcommit" }
local buf = vim.api.nvim_get_current_buf()
if vim.tbl_contains(exclude, vim.bo[buf].filetype) then
return
end
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,
})
-- close some filetypes with <q>
vim.api.nvim_create_autocmd("FileType", {
group = augroup("close_with_q"),
pattern = {
"PlenaryTestPopup",
"help",
"lspinfo",
"man",
"notify",
"qf",
"spectre_panel",
"startuptime",
"tsplayground",
"neotest-output",
"checkhealth",
"neotest-summary",
"neotest-output-panel",
},
callback = function(event)
vim.bo[event.buf].buflisted = false
vim.keymap.set("n", "q", "<cmd>close<cr>", { buffer = event.buf, silent = true })
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
vim.opt_local.spell = true
end,
})
-- Auto create dir when saving a file, in case some intermediate directory does not exist
vim.api.nvim_create_autocmd({ "BufWritePre" }, {
group = augroup("auto_create_dir"),
callback = function(event)
if event.match:match("^%w%w+://") then
return
end
local file = vim.loop.fs_realpath(event.match) or event.match
vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p")
end,
})

View File

@@ -13,20 +13,19 @@ local wk = require("which-key")
-- │ Register keybindings │ -- │ Register keybindings │
-- ╰──────────────────────────────────────────────────────────╯ -- ╰──────────────────────────────────────────────────────────╯
-- Register in all modes, prefix <leader> -- ╭──────────────────────────────────────────────────────────╮
-- │ Register in all modes, prefix <leader> │
-- ╰──────────────────────────────────────────────────────────╯
wk.register({ wk.register({
b = { b = {
name = "[b]uffer", name = "+buffer",
n = { n = { "<cmd>tabnew<cr>", "[n]ew tab" },
"<cmd>tabnew<cr>",
"[n]ew tab",
},
a = { a = {
name = "[a]nnotate" name = "+annotate"
-- defined in plugins/neogen.lua -- defined in plugins/neogen.lua
}, },
c = { c = {
name = "[c]omments", name = "+comments",
b = { b = {
"<cmd>lua require('comment-box').lbox()<cr>", "<cmd>lua require('comment-box').lbox()<cr>",
"Left aligned fixed size box with left aligned text", "Left aligned fixed size box with left aligned text",
@@ -41,53 +40,42 @@ wk.register({
}, },
}, },
d = { d = {
name = "[d]elete buffers", name = "+delete buffers",
h = { h = {
"<CMD>lua require('close_buffers').delete({type = 'hidden'})<CR>", "<CMD>lua require('close_buffers').delete({type = 'hidden'})<CR>",
"Delete hidden buffers", "Delete hidden buffers",
}, },
}, },
g = { t = { ":TabnineToggle<cr>", "Toggle TabNine" },
name = "[g]oto buffer",
["1"] = { "<cmd>buffer! 1<cr>", "Buffer 1" },
["2"] = { "<cmd>buffer! 2<cr>", "Buffer 2" },
["3"] = { "<cmd>buffer! 3<cr>", "Buffer 3" },
["4"] = { "<cmd>buffer! 4<cr>", "Buffer 4" },
["5"] = { "<cmd>buffer! 5<cr>", "Buffer 5" },
["6"] = { "<cmd>buffer! 6<cr>", "Buffer 6" },
["7"] = { "<cmd>buffer! 7<cr>", "Buffer 7" },
["8"] = { "<cmd>buffer! 8<cr>", "Buffer 8" },
["9"] = { "<cmd>buffer! 9<cr>", "Buffer 9" },
},
}, },
D = { D = {
name = "[D]iagnostics (Trouble)", name = "+Diagnostics (Trouble)",
t = { ":TroubleToggle<CR>", "[D]iagnostics [t]oggle" }, t = { ":TroubleToggle<CR>", "[D]iagnostics [t]oggle" },
-- Quick navigation between diagonostics. -- Quick navigation between diagonostics.
f = { ":lua vim.diagnostic.open_float()<CR>", "[D]iagnostics: Open [f]loat" }, f = { ":lua vim.diagnostic.open_float()<CR>", "[D]iagnostics: Open [f]loat" },
n = { ":lua vim.diagnostic.goto_next()<CR>", "[D]iagnostics: [n]ext" }, n = { ":lua vim.diagnostic.goto_next()<CR>", "[D]iagnostics: [n]ext" },
p = { ":lua vim.diagnostic.goto_prev()<CR>", "[D]iagnostics: [p]rev" }, p = { ":lua vim.diagnostic.goto_prev()<CR>", "[D]iagnostics: [p]rev" },
---
x = { function() require("trouble").open() end, "Open Trouble" },
w = { function() require("trouble").open("workspace_diagnostics") end, "Workspace diagnostics" },
d = { function() require("trouble").open("document_diagnostics") end, "Document diagnostics" },
q = { function() require("trouble").open("quickfix") end, "Quickfix" },
l = { function() require("trouble").open("loclist") end, "Loclist" },
r = { function() require("trouble").open("lsp_references") end, "LSP References" },
}, },
e = { e = {
function() vim.cmd("Neotree focus source=filesystem position=left") end, function() vim.cmd("Neotree focus source=filesystem position=left") end,
"Toggle the sidebar tree of the root folder.", "Toggle the sidebar tree",
}, },
f = { f = {
name = "[f]ind", name = "+find",
-- Find recursively files across the root folder subfiles. -- Find recursively files across the root folder subfiles.
f = { ':lua require("telescope.builtin").find_files()<cr>', "[f]ind [f]iles" }, f = { ':lua require("telescope.builtin").find_files()<cr>', "[f]ind [f]iles" },
-- Find recursively a text across the root folder subfiles. -- Find recursively a text across the root folder subfiles.
g = { ':lua require("telescope.builtin").live_grep()<cr>', "[f]ind text with [g]rep" }, g = { ':lua require("telescope.builtin").live_grep()<cr>', "[f]ind text with [g]rep" },
}, },
G = {
-- defined in plugins/gitsigns.lua
name = "Git",
b = {
name = "blame",
},
},
h = { h = {
name = "[h]arpoon", name = "+harpoon",
a = { "<cmd>lua require('harpoon.mark').add_file()<cr>", "[h]arpoon: [A]dd file" }, a = { "<cmd>lua require('harpoon.mark').add_file()<cr>", "[h]arpoon: [A]dd file" },
r = { "<cmd>lua require('harpoon.mark').rm_file()<cr>", "[h]arpoon: [r]emove file" }, r = { "<cmd>lua require('harpoon.mark').rm_file()<cr>", "[h]arpoon: [r]emove file" },
m = { "<cmd>lua require('harpoon.ui').toggle_quick_menu()<cr>", "[h]arpoon: harpoon [m]enu" }, m = { "<cmd>lua require('harpoon.ui').toggle_quick_menu()<cr>", "[h]arpoon: harpoon [m]enu" },
@@ -99,44 +87,54 @@ wk.register({
}, },
--- Remap debugging to "H" from LV default of "h" --- Remap debugging to "H" from LV default of "h"
H = { H = {
name = "[H]elp/Conceal/Treesitter", name = "+help/Conceal/Treesitter",
c = { c = {
name = "[c]onceal", name = "+conceal",
h = { ":set conceallevel=1<cr>", "hide/conceal" }, h = { ":set conceallevel=1<cr>", "hide/conceal" },
s = { ":set conceallevel=0<cr>", "show/unconceal" }, s = { ":set conceallevel=0<cr>", "show/unconceal" },
}, },
t = { t = {
name = "Treesitter", name = "+treesitter",
t = { vim.treesitter.inspect_tree, "show tree" }, t = { vim.treesitter.inspect_tree, "show tree" },
c = { ":=vim.treesitter.get_captures_at_cursor()<cr>", "show capture" }, c = { ":=vim.treesitter.get_captures_at_cursor()<cr>", "show capture" },
n = { ":=vim.treesitter.get_node():type()<cr>", "show node" }, n = { ":=vim.treesitter.get_node():type()<cr>", "show node" },
}, },
}, },
o = {
g = {
-- defined in plugins/gitsigns.lua
name = "+git",
b = {
name = "+blame",
},
},
},
p = { p = {
name = "[p]lugins", name = "+plugins",
i = { function() require("lazy").install() end, "[p]lugins [i]nstall" }, i = { function() require("lazy").install() end, "plugins [i]nstall" },
s = { function() require("lazy").home() end, "[p]lugins [s]tatus" }, s = { function() require("lazy").home() end, "plugins [s]tatus" },
S = { function() require("lazy").sync() end, "[p]lugins [S]ync" }, S = { function() require("lazy").sync() end, "plugins [S]ync" },
u = { function() require("lazy").check() end, "[p]lugins Check [u]pdates" }, u = { function() require("lazy").check() end, "plugins Check [u]pdates" },
U = { function() require("lazy").update() end, "[p]lugins [U]pdate" }, U = { function() require("lazy").update() end, "plugins [U]pdate" },
}, },
q = { q = {
name = "[q]uit", name = "+quit",
q = { ":qa<cr>", "[q]uit: [q]uit all" }, q = { ":qa<cr>", "quit: [q]uit all" },
f = { ":qa!<cr>", "[q]uit: all with [f]orce" }, f = { ":qa!<cr>", "quit: all with [f]orce" },
}, },
r = { r = {
-- defined in plugins/refactoring-nvim.lua -- defined in plugins/refactoring-nvim.lua
name = "[r]efactor", name = "+refactor",
}, },
t = { t = {
name = "[t]elescope", name = "+telescope",
-- Find recursively TODOs, NOTEs, FIXITs, ... across the root folder subfiles. -- Find recursively TODOs, NOTEs, FIXITs, ... across the root folder subfiles.
t = { ":TodoTelescope<cr>", "[t]elescope: [t]odo" }, t = { ":TodoTelescope<cr>", "[t]elescope: [t]odo" },
}, },
x = { ":Bdelete<CR>", "[x]: Close current buffer" }, x = { ":Bdelete<CR>", "Close current buffer" },
}, { prefix = "<leader>" }) }, { prefix = "<leader>" })
--
-- ╭──────────────────────────────────────────────────────────╮ -- ╭──────────────────────────────────────────────────────────╮
-- │ Normal mode, prefix <leader> │ -- │ Normal mode, prefix <leader> │
-- ╰──────────────────────────────────────────────────────────╯ -- ╰──────────────────────────────────────────────────────────╯
@@ -144,6 +142,7 @@ wk.register({
b = { name = "Buffer" }, b = { name = "Buffer" },
}, { mode = "n", prefix = "<leader>" }) }, { mode = "n", prefix = "<leader>" })
--
-- ╭──────────────────────────────────────────────────────────╮ -- ╭──────────────────────────────────────────────────────────╮
-- │ Insert mode, prefix <leader> │ -- │ Insert mode, prefix <leader> │
-- ╰──────────────────────────────────────────────────────────╯ -- ╰──────────────────────────────────────────────────────────╯
@@ -151,6 +150,7 @@ wk.register({
b = { name = "Buffer" }, b = { name = "Buffer" },
}, { mode = "i", prefix = "<leader>" }) }, { mode = "i", prefix = "<leader>" })
--
-- ╭──────────────────────────────────────────────────────────╮ -- ╭──────────────────────────────────────────────────────────╮
-- │ Insert mode, no prefix │ -- │ Insert mode, no prefix │
-- ╰──────────────────────────────────────────────────────────╯ -- ╰──────────────────────────────────────────────────────────╯
@@ -159,6 +159,7 @@ wk.register({
["<C-Home>"] = { "<Home>", "Do just Home on CTRL + Home" }, ["<C-Home>"] = { "<Home>", "Do just Home on CTRL + Home" },
}, { mode = "i", prefix = "" }) }, { mode = "i", prefix = "" })
--
-- ╭──────────────────────────────────────────────────────────╮ -- ╭──────────────────────────────────────────────────────────╮
-- │ All modes, no prefix │ -- │ All modes, no prefix │
-- ╰──────────────────────────────────────────────────────────╯ -- ╰──────────────────────────────────────────────────────────╯
@@ -167,6 +168,11 @@ wk.register({
["<C-End>"] = { "<End>", "Do just End on CTRL + End" }, ["<C-End>"] = { "<End>", "Do just End on CTRL + End" },
}, { prefix = "" }) }, { prefix = "" })
--
-- ╭──────────────────────────────────────────────────────────╮
-- │ Other keymappings, still to move │
-- ╰──────────────────────────────────────────────────────────╯
local key = vim.api.nvim_set_keymap local key = vim.api.nvim_set_keymap
local remap = { noremap = true, silent = true } local remap = { noremap = true, silent = true }
@@ -182,19 +188,6 @@ key("i", "<Up>", [[v:count ? 'k' : '<c-o>gk']], { expr = true, noremap = true, s
key("n", "<Down>", [[v:count ? 'j' : 'gj']], { expr = true, noremap = true, silent = true }) key("n", "<Down>", [[v:count ? 'j' : 'gj']], { expr = true, noremap = true, silent = true })
key("n", "<Up>", [[v:count ? 'k' : 'gk']], { expr = true, noremap = true, silent = true }) key("n", "<Up>", [[v:count ? 'k' : 'gk']], { expr = true, noremap = true, silent = true })
-- Set 'CTRL + v' as 'paster'
key("v", "<C-v>", "p", remap)
-- Set 'CTRL + x' as 'cut'
key("v", "<C-x>", "mad`ai<Right>", { silent = true })
-- Set 'CTRL + c' as 'copier'
key("v", "<C-c>", "may`ai", remap)
key("i", "<C-v>", "<Esc>:Registers<CR>", remap)
-- Create mark.
key("n", "'", "`", remap)
-- Move normaly bottom and up with C+Up and C+Down. -- Move normaly bottom and up with C+Up and C+Down.
key("i", "<C-Up>", "<C-o>gk", remap) key("i", "<C-Up>", "<C-o>gk", remap)
key("i", "<C-Down>", "<C-o>gj", remap) key("i", "<C-Down>", "<C-o>gj", remap)
@@ -221,14 +214,6 @@ key("i", "<S-Down>", "<C-o>v<Down>", remap)
key("i", "<S-Left>", "<Esc>v<Left>", remap) key("i", "<S-Left>", "<Esc>v<Left>", remap)
key("i", "<S-Right>", "<C-o>v<Right>", remap) key("i", "<S-Right>", "<C-o>v<Right>", remap)
-- Set 'SHIFT + special-keys' as 'select' like a modern text editor.
key("i", "<S-Home>", "<Esc>v<Home>", remap)
key("i", "<S-End>", "<C-o>v<End><Left>", remap)
key("n", "<S-Home>", "v<Home>", remap)
key("n", "<S-End>", "v<End><Left>", remap)
key("n", "<S-PageUp>", "", remap)
key("n", "<S-PageDown>", "<Esc>:call Visual_Scroll_Down()<CR>i<Right><Left>", remap)
-- Indent the current visual selection. -- Indent the current visual selection.
key("v", "<", "<gv", remap) key("v", "<", "<gv", remap)
key("v", ">", ">gv", remap) key("v", ">", ">gv", remap)

View File

@@ -4,8 +4,6 @@ local vim = vim
CAPABILITIES = vim.lsp.protocol.make_client_capabilities() CAPABILITIES = vim.lsp.protocol.make_client_capabilities()
CAPABILITIES.textDocument.completion.completionItem.snippetSupport = true CAPABILITIES.textDocument.completion.completionItem.snippetSupport = true
--CAPABILITIES.offsetEncoding = 'utf-8'
-- [[ Configure LSP ]] -- [[ Configure LSP ]]
-- This function gets run when an LSP connects to a particular buffer. -- This function gets run when an LSP connects to a particular buffer.
local on_attach = function(_, bufnr) local on_attach = function(_, bufnr)

View File

@@ -15,7 +15,7 @@ return {
floating_window = true, -- show hint in a floating window, set to false for virtual text only mode floating_window = true, -- show hint in a floating window, set to false for virtual text only mode
floating_window_above_cur_line = false, -- try to place the floating above the current line when possible Note: floating_window_above_cur_line = true, -- try to place the floating above the current line when possible Note:
-- will set to true when fully tested, set to false will use whichever side has more space -- will set to true when fully tested, set to false will use whichever side has more space
-- this setting will be helpful if you do not want the PUM and floating win overlap -- this setting will be helpful if you do not want the PUM and floating win overlap
close_timeout = 4000, -- close floating window after ms when laster parameter is entered close_timeout = 4000, -- close floating window after ms when laster parameter is entered

View File

@@ -1,57 +1,29 @@
-- luacheck: globals vim -- luacheck: globals vim
-- Fix moving through lines 'gk' and 'gj'
vim.wo.linebreak = true
-- Enable break indent
vim.o.breakindent = true
-- Use the new FileType system of Neovim. -- Use the new FileType system of Neovim.
-- let g:do_filetype_lua = 1 -- let g:do_filetype_lua = 1
-- Save undo history vim.wo.linebreak = true -- Fix moving through lines 'gk' and 'gj'
vim.o.undofile = true vim.o.breakindent = true -- Enable break indent
vim.o.undofile = true -- Save undo history
-- Show lines number (hybrid) vim.wo.number = true -- Show lines number (hybrid)
vim.wo.number = true vim.wo.relativenumber = true -- Show lines number (hybrid)
vim.wo.relativenumber = true vim.wo.signcolumn = "yes" -- Keep signcolumn on by default
-- Keep signcolumn on by default
vim.wo.signcolumn = "yes"
-- Case-insensitive searching UNLESS \C or capital in search -- Case-insensitive searching UNLESS \C or capital in search
vim.o.ignorecase = true vim.o.ignorecase = true
vim.o.smartcase = true vim.o.smartcase = true
-- To have a extra line :) vim.o.cmdheight = 0 -- To have a extra line :)
vim.o.cmdheight = 0 vim.wo.wrap = true -- Set wrap for words
vim.o.showtabline = 2 -- Always show tabs
-- Set wrap for words vim.opt.list = true -- Show xtra spaces
vim.wo.wrap = true vim.o.wildmenu = true -- Set wildmenu for later use
vim.o.hlsearch = true -- Highlighting search
-- Always show tabs vim.o.ruler = true -- Set ruler for better look
vim.o.showtabline = 2 vim.o.hidden = true -- No nice message
vim.o.showcmd = true -- Partial commands only in the screen
-- Show xtra spaces vim.o.showmatch = true -- Match braces when inserting new ones
vim.opt.list = true
-- Set wildmenu for later use
vim.o.wildmenu = true
-- Highlighting search
vim.o.hlsearch = true
-- Set ruler for better look
vim.o.ruler = true
-- No nice message
vim.o.hidden = true
-- Partial commands only in the screen
vim.o.showcmd = true
-- Match braces when inserting new ones :)
vim.o.showmatch = true
-- Cursor line -- Cursor line
---- Cursor column ---- Cursor column
@@ -60,39 +32,19 @@ vim.wo.cursorline = true
vim.o.cursorcolumn = true vim.o.cursorcolumn = true
vim.wo.cursorcolumn = true vim.wo.cursorcolumn = true
-- Off scroll when moving through the buffer vim.o.scrolloff = 40 -- Off scroll when moving through the buffer
vim.o.scrolloff = 40 vim.go.termguicolors = true -- For terminal RGB colours
vim.go.t_Co = "256" -- Colours, I believe
vim.go.t_ut = "" -- Colours, I believe
vim.o.laststatus = 3 -- Space for tabs
vim.o.softtabstop = 2 -- Space for tabs
vim.o.expandtab = true -- Expand tab to use spaces instead
vim.o.tabstop = 2 -- Space for tabs
vim.bo.shiftwidth = 2 -- Space for tabs
vim.o.shiftwidth = 2 -- Space for tabs
-- For terminal RGB colours vim.o.formatoptions = "tqj" -- Format options to not create new lines with comments
vim.go.termguicolors = true vim.o.mouse = "a" -- Mouse working with neovim
-- Colours, I believe
vim.go.t_Co = "256"
vim.go.t_ut = ""
-- Space for tabs
vim.o.laststatus = 3
-- Space for tabs
vim.o.softtabstop = 2
-- Expand tab to use spaces instead
vim.o.expandtab = true
-- Space for tabs
vim.o.tabstop = 2
-- Space for tabs
vim.bo.shiftwidth = 2
-- Space for tabs
vim.o.shiftwidth = 2
-- Format options to not create new lines with comments
vim.o.formatoptions = "tqj"
-- Mouse working with neovim
vim.o.mouse = "a"
-- viminfo file -- viminfo file
-- vim.o.viminfo = vim.o.viminfo .. '~/.config/nvim/viminfo' -- vim.o.viminfo = vim.o.viminfo .. '~/.config/nvim/viminfo'
@@ -101,17 +53,13 @@ vim.o.mouse = "a"
vim.o.spelllang = "en_gb" vim.o.spelllang = "en_gb"
vim.bo.spelllang = "en_gb" vim.bo.spelllang = "en_gb"
-- Global statusline. vim.opt.laststatus = 2 -- Global statusline.
vim.opt.laststatus = 2
-- When "on" the commands listed below move the cursor to the first non-blank -- When "on" the commands listed below move the cursor to the first non-blank
-- of the line. When off the cursor is kept in the same column (if possible). -- of the line. When off the cursor is kept in the same column (if possible).
-- https://neovim.io/doc/user/options.html#'startofline' -- https://neovim.io/doc/user/options.html#'startofline'
vim.opt.startofline = true vim.opt.startofline = true
-- Columns line "limit"
-- vim.o.cc = '85'
-- Set path for better searching across the system -- Set path for better searching across the system
-- vim.o.path = vim.o.path .. '**' -- vim.o.path = vim.o.path .. '**'
@@ -119,8 +67,7 @@ vim.opt.startofline = true
vim.o.completeopt = "menuone,longest,noselect" vim.o.completeopt = "menuone,longest,noselect"
vim.o.shortmess = vim.o.shortmess .. "c" vim.o.shortmess = vim.o.shortmess .. "c"
-- Menu Transparency. vim.go.pumblend = 10 -- Menu Transparency.
vim.go.pumblend = 10
-- ╭──────────────────────────────────────────────────────────╮ -- ╭──────────────────────────────────────────────────────────╮
-- │ Variables │ -- │ Variables │

View File

@@ -27,14 +27,11 @@ local options = {
}, },
rtp = { rtp = {
disabled_plugins = { disabled_plugins = {
"gzip",
"matchit", "matchit",
"matchparen", "matchparen",
"netrwPlugin", "netrwPlugin",
"tarPlugin",
"tohtml", "tohtml",
"tutor", "tutor",
"zipPlugin",
}, },
}, },
}, },

View File

@@ -13,8 +13,8 @@ return {
changedelete = { hl = "GitSignsChange", text = "~", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" }, changedelete = { hl = "GitSignsChange", text = "~", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" },
}, },
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
numhl = false, -- Toggle with `:Gitsigns toggle_numhl` numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
linehl = false, -- Toggle with `:Gitsigns toggle_linehl` linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
on_attach = function(bufnr) on_attach = function(bufnr)
local gs = package.loaded.gitsigns local gs = package.loaded.gitsigns
@@ -39,19 +39,19 @@ return {
end, { expr = true }) end, { expr = true })
-- Actions -- Actions
map("n", "<leader>Ghs", gs.stage_hunk, { desc = "Stage Hunk" }) map("n", "<leader>oghs", gs.stage_hunk, { desc = "Stage Hunk" })
map("n", "<leader>Ghr", gs.reset_hunk, { desc = "Reset Hunk" }) map("n", "<leader>oghr", gs.reset_hunk, { desc = "Reset Hunk" })
map("v", "<leader>Ghs", function() gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") }) end) map("v", "<leader>oghs", function() gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") }) end)
map("v", "<leader>Ghr", function() gs.reset_hunk({ vim.fn.line("."), vim.fn.line("v") }) end) map("v", "<leader>oghr", function() gs.reset_hunk({ vim.fn.line("."), vim.fn.line("v") }) end)
map("n", "<leader>GhS", gs.stage_buffer, { desc = "Stage Buffer" }) map("n", "<leader>oghS", gs.stage_buffer, { desc = "Stage Buffer" })
map("n", "<leader>Ghu", gs.undo_stage_hunk, { desc = "Undo Stage Hunk" }) map("n", "<leader>oghu", gs.undo_stage_hunk, { desc = "Undo Stage Hunk" })
map("n", "<leader>GhR", gs.reset_buffer, { desc = "Reset Buffer" }) map("n", "<leader>oghR", gs.reset_buffer, { desc = "Reset Buffer" })
map("n", "<leader>Ghp", gs.preview_hunk, { desc = "Preview Hunk" }) map("n", "<leader>oghp", gs.preview_hunk, { desc = "Preview Hunk" })
map("n", "<leader>Gbl", function() gs.blame_line({ full = true }) end, { desc = "Blame Line" }) map("n", "<leader>ogbl", function() gs.blame_line({ full = true }) end, { desc = "Blame Line" })
map("n", "<leader>Gbt", gs.toggle_current_line_blame, { desc = "Toggle Current Line Blame" }) map("n", "<leader>ogbt", gs.toggle_current_line_blame, { desc = "Toggle Current Line Blame" })
map("n", "<leader>Ghd", gs.diffthis, { desc = "Diff This" }) map("n", "<leader>oghd", gs.diffthis, { desc = "Diff This" })
map("n", "<leader>GhD", function() gs.diffthis("~") end) map("n", "<leader>oghD", function() gs.diffthis("~") end)
map("n", "<leader>Gtd", gs.toggle_deleted, { desc = "Toggle Deleted" }) map("n", "<leader>ogtd", gs.toggle_deleted, { desc = "Toggle Deleted" })
-- Text object -- Text object
map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>") map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>")

View File

@@ -162,7 +162,19 @@ return {
"m4xshen/smartcolumn.nvim", "m4xshen/smartcolumn.nvim",
opts = { opts = {
colorcolumn = { "80", "100", "120" }, colorcolumn = { "80", "100", "120" },
disabled_filetypes = { "help", "text", "markdown", "json", "lazy", "starter", "neo-tree" }, disabled_filetypes = {
"dashboard",
"help",
"json",
"lazy",
"lazyterm",
"mason",
"neo-tree",
"notify",
"starter",
"toggleterm",
"Trouble",
},
}, },
}, },
@@ -216,7 +228,10 @@ return {
build = vim.loop.os_uname().sysname == "Windows_NT" and "pwsh.exe -file .\\dl_binaries.ps1" or "./dl_binaries.sh", build = vim.loop.os_uname().sysname == "Windows_NT" and "pwsh.exe -file .\\dl_binaries.ps1" or "./dl_binaries.sh",
cmd = { "TabnineStatus", "TabnineDisable", "TabnineEnable", "TabnineToggle" }, cmd = { "TabnineStatus", "TabnineDisable", "TabnineEnable", "TabnineToggle" },
event = "User", event = "User",
opts = { accept_keymap = "<C-e>" }, opts = {
accept_keymap = "<C-CR>",
dismiss_keymap = "<C-Esc>",
},
}, },
-- Vim plugin for automatic time tracking and metrics generated from your programming activity. -- Vim plugin for automatic time tracking and metrics generated from your programming activity.

View File

@@ -62,11 +62,11 @@ return {
-- Autocompletion and signature help plugin -- Autocompletion and signature help plugin
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-completion.md -- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-completion.md
require("mini.completion").setup() -- require("mini.completion").setup()
-- Automatic highlighting of word under cursor -- Automatic highlighting of word under cursor
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-cursorword.md -- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-cursorword.md
require("mini.cursorword").setup() -- require("mini.cursorword").setup()
-- Highlight patterns in text -- Highlight patterns in text
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-hipatterns.md -- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-hipatterns.md
@@ -86,7 +86,12 @@ return {
-- Visualize and work with indent scope -- Visualize and work with indent scope
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-indentscope.md -- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-indentscope.md
require("mini.indentscope").setup() require("mini.indentscope").setup({
draw = {
delay = 0,
-- animation = require("mini.indentscope").gen_animation("none"),
},
})
-- Jump to next/previous single character -- Jump to next/previous single character
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-jump.md -- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-jump.md

View File

@@ -9,7 +9,7 @@ return {
-- position of the list can be: bottom, top, left, right -- position of the list can be: bottom, top, left, right
position = "bottom", position = "bottom",
-- height of the trouble list when position is top or bottom -- height of the trouble list when position is top or bottom
height = 10, height = 6,
-- width of the list when position is left or right -- width of the list when position is left or right
width = 50, width = 50,
-- use devicons for filenames -- use devicons for filenames
@@ -68,7 +68,7 @@ return {
-- add an indent guide below the fold icons -- add an indent guide below the fold icons
indent_lines = true, indent_lines = true,
-- automatically open the list when you have diagnostics -- automatically open the list when you have diagnostics
auto_open = true, auto_open = false,
-- automatically close the list when you have no diagnostics -- automatically close the list when you have no diagnostics
auto_close = true, auto_close = true,
-- automatically preview the location of the diagnostic. -- automatically preview the location of the diagnostic.