From d2fc21ae088e0c078c39f7fb9f313b808e7e90b7 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sat, 1 May 2021 14:26:11 +0200 Subject: Removed bloat, added some sweet features, synced with Lunarvim repo --- .config/nvim/init.lua | 3 +- .config/nvim/language-settings.lua | 5 ++ .config/nvim/lua/_autocommands/init.lua | 8 +- .config/nvim/lua/_comment/init.lua | 2 - .config/nvim/lua/_compe/init.lua | 96 +++++++++++++++----- .config/nvim/lua/_hop/init.lua | 2 - .config/nvim/lua/_nvimtree/init.lua | 7 +- .config/nvim/lua/_true-zen/init.lua | 67 ++++++++++++++ .config/nvim/lua/_vim-bbye/init.lua | 1 - .config/nvim/lua/_which-key/init.lua | 136 ++++++++++++++++++++++++++++ .config/nvim/lua/mappings.lua | 42 +++------ .config/nvim/lua/plugins.lua | 9 +- .config/nvim/lua/settings.lua | 8 +- .config/nvim/vim-script/_whichkey/init.vim | 140 ----------------------------- 14 files changed, 317 insertions(+), 209 deletions(-) delete mode 100644 .config/nvim/lua/_hop/init.lua create mode 100644 .config/nvim/lua/_true-zen/init.lua delete mode 100644 .config/nvim/lua/_vim-bbye/init.lua create mode 100644 .config/nvim/lua/_which-key/init.lua delete mode 100644 .config/nvim/vim-script/_whichkey/init.vim diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 0ba8481..43a3b12 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -20,8 +20,9 @@ require('_rnvimr') require('_vim-rooter') require('_quickscope') require('_neogit') +require('_which-key') +require('_true-zen') -vim.cmd('source ~/.config/nvim/vim-script/_whichkey/init.vim') vim.cmd('source ~/.config/nvim/vim-script/functions.vim') -- LSP diff --git a/.config/nvim/language-settings.lua b/.config/nvim/language-settings.lua index 36a5d05..54e98b2 100644 --- a/.config/nvim/language-settings.lua +++ b/.config/nvim/language-settings.lua @@ -28,3 +28,8 @@ O.tsserver.autoformat = true -- json O.json.autoformat = true +O.json.formatter = 'prettier' + +-- sh +O.sh.linter = 'shellcheck' +O.sh.formatter = 'shfmt' diff --git a/.config/nvim/lua/_autocommands/init.lua b/.config/nvim/lua/_autocommands/init.lua index a94cb0f..1642127 100644 --- a/.config/nvim/lua/_autocommands/init.lua +++ b/.config/nvim/lua/_autocommands/init.lua @@ -7,9 +7,13 @@ if O.python.autoformat then table.insert(auto_formatters, python_autoformat) end local javascript_autoformat = {'BufWritePre', '*.js', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'} local javascriptreact_autoformat = {'BufWritePre', '*.jsx', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'} +local typescript_autoformat = {'BufWritePre', '*.ts', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'} +local typescriptreact_autoformat = {'BufWritePre', '*.tsx', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'} if O.tsserver.autoformat then table.insert(auto_formatters, javascript_autoformat) table.insert(auto_formatters, javascriptreact_autoformat) + table.insert(auto_formatters, typescript_autoformat) + table.insert(auto_formatters, typescriptreact_autoformat) end local lua_format = {'BufWritePre', '*.lua', 'lua vim.lsp.buf.formatting_sync(nil, 1000)'} @@ -20,7 +24,7 @@ if O.json.autoformat then table.insert(auto_formatters, json_format) end utils.define_augroups({ _general_settings = { - {'TextYankPost','*', 'lua require(\'vim.highlight\').on_yank({higroup = \'Search\', timeout = 200})'}, + {'TextYankPost', '*', 'lua require(\'vim.highlight\').on_yank({higroup = \'Search\', timeout = 200})'}, {'BufWinEnter', '*', 'setlocal formatoptions-=c formatoptions-=r formatoptions-=o'}, {'BufRead', '*', 'setlocal formatoptions-=c formatoptions-=r formatoptions-=o'}, {'BufNewFile', '*', 'setlocal formatoptions-=c formatoptions-=r formatoptions-=o'}, @@ -51,4 +55,4 @@ utils.define_augroups({ {'FileType', 'floaterm', 'nnoremap q :q'}, }, _auto_formatters = auto_formatters -}) +}) diff --git a/.config/nvim/lua/_comment/init.lua b/.config/nvim/lua/_comment/init.lua index 8d2ad52..e1f1358 100644 --- a/.config/nvim/lua/_comment/init.lua +++ b/.config/nvim/lua/_comment/init.lua @@ -1,3 +1 @@ require('nvim_comment').setup() -vim.api.nvim_set_keymap("n", "gc", ":CommentToggle", {noremap=true, silent = true}) -vim.api.nvim_set_keymap("v", "gc", ":CommentToggle", {noremap=true, silent = true}) diff --git a/.config/nvim/lua/_compe/init.lua b/.config/nvim/lua/_compe/init.lua index 6127096..d386505 100644 --- a/.config/nvim/lua/_compe/init.lua +++ b/.config/nvim/lua/_compe/init.lua @@ -15,20 +15,20 @@ require'compe'.setup { documentation = true, source = { - path = {kind = "  "}, - buffer = {kind = "  "}, - calc = {kind = "  "}, - vsnip = {kind = "  "}, - nvim_lsp = {kind = "  "}, + path = {kind = "  (Path)"}, + buffer = {kind = "  (Buffer)"}, + calc = {kind = "  (Calc)"}, + vsnip = {kind = "  (Snippet)"}, + nvim_lsp = {kind = "  (LSP)"}, -- nvim_lua = {kind = "  "}, nvim_lua = false, - spell = {kind = "  "}, + spell = {kind = "  (Spell)"}, tags = false, vim_dadbod_completion = true, -- snippets_nvim = {kind = "  "}, -- ultisnips = {kind = "  "}, -- treesitter = {kind = "  "}, - emoji = {kind = " ﲃ ", filetypes={"markdown", "text"}} + emoji = {kind = " ﲃ (Emoji)", filetypes={"markdown", "text"}} -- for emoji press : (idk if that in compe tho) } } @@ -59,8 +59,56 @@ require'compe'.setup { --  --  +-- local t = function(str) +-- return vim.api.nvim_replace_termcodes(str, true, true, true) +-- end + +-- local check_back_space = function() +-- local col = vim.fn.col('.') - 1 +-- if col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') then +-- return true +-- else +-- return false +-- end +-- end + +-- -- Use (s-)tab to: +-- --- move to prev/next item in completion menuone +-- --- jump to prev/next snippet's placeholder +-- _G.tab_complete = function() +-- if vim.fn.pumvisible() == 1 then +-- return t "" +-- elseif vim.fn.call("vsnip#available", {1}) == 1 then +-- return t "(vsnip-expand-or-jump)" +-- elseif check_back_space() then +-- return t "" +-- else +-- return vim.fn['compe#complete']() +-- end +-- end +-- _G.s_tab_complete = function() +-- if vim.fn.pumvisible() == 1 then +-- return t "" +-- elseif vim.fn.call("vsnip#jumpable", {-1}) == 1 then +-- return t "(vsnip-jump-prev)" +-- else +-- return t "" +-- end +-- end + +-- vim.api.nvim_set_keymap("i", "", "v:lua.tab_complete()", {expr = true}) +-- vim.api.nvim_set_keymap("s", "", "v:lua.tab_complete()", {expr = true}) +-- vim.api.nvim_set_keymap("i", "", "v:lua.s_tab_complete()", {expr = true}) +-- vim.api.nvim_set_keymap("s", "", "v:lua.s_tab_complete()", {expr = true}) + + + + + + + local t = function(str) - return vim.api.nvim_replace_termcodes(str, true, true, true) + return vim.api.nvim_replace_termcodes(str, true, true, true) end local check_back_space = function() @@ -76,24 +124,24 @@ end --- move to prev/next item in completion menuone --- jump to prev/next snippet's placeholder _G.tab_complete = function() - if vim.fn.pumvisible() == 1 then - return t "" - elseif vim.fn.call("vsnip#available", {1}) == 1 then - return t "(vsnip-expand-or-jump)" - elseif check_back_space() then - return t "" - else - return vim.fn['compe#complete']() - end + if vim.fn.pumvisible() == 1 then + return t "" + elseif vim.fn.call("vsnip#available", {1}) == 1 then + return t "(vsnip-expand-or-jump)" + elseif check_back_space() then + return t "" + else + return vim.fn['compe#complete']() + end end _G.s_tab_complete = function() - if vim.fn.pumvisible() == 1 then - return t "" - elseif vim.fn.call("vsnip#jumpable", {-1}) == 1 then - return t "(vsnip-jump-prev)" - else - return t "" - end + if vim.fn.pumvisible() == 1 then + return t "" + elseif vim.fn.call("vsnip#jumpable", {-1}) == 1 then + return t "(vsnip-jump-prev)" + else + return t "" + end end vim.api.nvim_set_keymap("i", "", "v:lua.tab_complete()", {expr = true}) diff --git a/.config/nvim/lua/_hop/init.lua b/.config/nvim/lua/_hop/init.lua deleted file mode 100644 index acd4cd7..0000000 --- a/.config/nvim/lua/_hop/init.lua +++ /dev/null @@ -1,2 +0,0 @@ -vim.api.nvim_set_keymap('n', 's', ":HopChar2", {silent = true}) -vim.api.nvim_set_keymap('n', 'S', ":HopWord", {silent = true}) diff --git a/.config/nvim/lua/_nvimtree/init.lua b/.config/nvim/lua/_nvimtree/init.lua index 11fe526..9f9cfd5 100644 --- a/.config/nvim/lua/_nvimtree/init.lua +++ b/.config/nvim/lua/_nvimtree/init.lua @@ -1,4 +1,5 @@ vim.g.nvim_tree_disable_netrw = 0 -- "1 by default, disables netrw +-- vim.g.nvim_tree_hijack_netrw = 0 --"1 by default, prevents netrw from automatically opening when opening directories (but lets you keep its other utilities) vim.g.nvim_tree_hide_dotfiles = 1 -- 0 by default, this option hides files and folders starting with a dot `.` vim.g.nvim_tree_indent_markers = 1 -- "0 by default, this option shows indent markers when folders are open vim.g.nvim_tree_follow = 1 -- "0 by default, this option allows the cursor to be updated when entering a buffer @@ -16,13 +17,13 @@ local tree_cb = require'nvim-tree.config'.nvim_tree_callback ["<2-LeftMouse>"] = tree_cb("edit"), ["<2-RightMouse>"] = tree_cb("cd"), [""] = tree_cb("cd"), - [""] = tree_cb("vsplit"), - [""] = tree_cb("split"), + ["v"] = tree_cb("vsplit"), + ["s"] = tree_cb("split"), [""] = tree_cb("tabnew"), ["<"] = tree_cb("prev_sibling"), [">"] = tree_cb("next_sibling"), [""] = tree_cb("close_node"), - ["h"] = tree_cb("close_node"), + ["h"] = tree_cb("close_node"), [""] = tree_cb("close_node"), [""] = tree_cb("preview"), ["I"] = tree_cb("toggle_ignored"), diff --git a/.config/nvim/lua/_true-zen/init.lua b/.config/nvim/lua/_true-zen/init.lua new file mode 100644 index 0000000..1abb9a0 --- /dev/null +++ b/.config/nvim/lua/_true-zen/init.lua @@ -0,0 +1,67 @@ +local true_zen = require("true-zen") + +-- setup for TrueZen.nvim +true_zen.setup({ + true_false_commands = false, + cursor_by_mode = false, + bottom = { + hidden_laststatus = 0, + hidden_ruler = false, + hidden_showmode = false, + hidden_showcmd = false, + hidden_cmdheight = 1, + + shown_laststatus = 2, + shown_ruler = true, + shown_showmode = false, + shown_showcmd = false, + shown_cmdheight = 1 + }, + top = { + hidden_showtabline = 0, + + shown_showtabline = 2 + }, + left = { + hidden_number = false, + hidden_relativenumber = false, + hidden_signcolumn = "no", + + shown_number = true, + shown_relativenumber = false, + shown_signcolumn = "no" + }, + ataraxis = { + just_do_it_for_me = false, + left_padding = 40, + right_padding = 40, + top_padding = 0, + bottom_padding = 0, + custome_bg = "", + disable_bg_configuration = false, + disable_fillchars_configuration = false, + force_when_plus_one_window = false, + force_hide_statusline = false + }, + focus = { + margin_of_error = 5, + focus_method = "experimental" + }, + events = { + before_minimalist_mode_shown = false, + before_minimalist_mode_hidden = false, + after_minimalist_mode_shown = false, + after_minimalist_mode_hidden = false + }, + integrations = { + integration_galaxyline = true, + integration_vim_airline = false, + integration_vim_powerline = false, + integration_tmux = false, + integration_express_line = false, + integration_gitgutter = false, + integration_vim_signify = false, + integration_limelight = false, + integration_tzfocus_tzataraxis = false + } +}) diff --git a/.config/nvim/lua/_vim-bbye/init.lua b/.config/nvim/lua/_vim-bbye/init.lua deleted file mode 100644 index 77b4c39..0000000 --- a/.config/nvim/lua/_vim-bbye/init.lua +++ /dev/null @@ -1 +0,0 @@ -vim.api.nvim_set_keymap('n', 'q', ':Bdelete', { noremap = true, silent = true }) diff --git a/.config/nvim/lua/_which-key/init.lua b/.config/nvim/lua/_which-key/init.lua new file mode 100644 index 0000000..65742b6 --- /dev/null +++ b/.config/nvim/lua/_which-key/init.lua @@ -0,0 +1,136 @@ +require("which-key").setup { + plugins = { + marks = true, -- shows a list of your marks on ' and ` + registers = true, -- shows your registers on " in NORMAL or in INSERT mode + -- the presets plugin, adds help for a bunch of default keybindings in Neovim + -- No actual key bindings are created + presets = { + operators = true, -- adds help for operators like d, y, ... + motions = true, -- adds help for motions + text_objects = true, -- help for text objects triggered after entering an operator + windows = true, -- default bindings on + nav = true, -- misc bindings to work with windows + z = true, -- bindings for folds, spelling and others prefixed with z + g = true -- bindings for prefixed with g + } + }, + icons = { + breadcrumb = "»", -- symbol used in the command line area that shows your active key combo + separator = "➜", -- symbol used between a key and it's label + group = "+" -- symbol prepended to a group + }, + window = { + border = "single", -- none, single, double, shadow + position = "bottom", -- bottom, top + margin = {1, 0, 1, 0}, -- extra window margin [top, right, bottom, left] + padding = {2, 2, 2, 2} -- extra window padding [top, right, bottom, left] + }, + layout = { + height = {min = 4, max = 25}, -- min and max height of the columns + width = {min = 20, max = 50}, -- min and max width of the columns + spacing = 3 -- spacing between columns + }, + hidden = {"", "", "", "", "call", "lua", "^:", "^ "}, -- hide mapping boilerplate + show_help = true -- show help message on the command line when the popup is visible +} + +local opts = { + mode = "n", -- NORMAL mode + prefix = "", + buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings + silent = true, -- use `silent` when creating keymaps + noremap = true, -- use `noremap` when creating keymaps + nowait = false -- use `nowait` when creating keymaps +} + +-- Set leader +vim.api.nvim_set_keymap('n', '', '', {noremap = true, silent = true}) +vim.g.mapleader = ' ' + +-- no hl +vim.api.nvim_set_keymap('n', 'h', ':set hlsearch!', {noremap = true, silent = true}) + +-- explorer +vim.api.nvim_set_keymap('n', 'e', ':NvimTreeToggle', {noremap = true, silent = true}) + +-- telescope +vim.api.nvim_set_keymap('n', 'f', ':Telescope find_files', {noremap = true, silent = true}) + +-- dashboard +vim.api.nvim_set_keymap('n', ';', ':Dashboard', {noremap = true, silent = true}) + +-- Comments +-- vim.api.nvim_set_keymap("n", "/", ":CommentToggle", {noremap = true, silent = true}) +-- vim.api.nvim_set_keymap("v", "/", ":CommentToggle", {noremap = true, silent = true}) + +-- Zen mode +vim.api.nvim_set_keymap("n", "z", ':TZAtaraxis', {noremap = true, silent = true}) + +-- close buffer +vim.api.nvim_set_keymap("n", "c", ":BufferClose", {noremap = true, silent = true}) + +-- TODO create entire treesitter section + +local mappings = { + -- ["/"] = "Comment", + ["c"] = "Close Buffer", + ["z"] = "Zen Mode", + ["e"] = "Explorer", + ["f"] = "Find File", + ["h"] = "No Highlight", + d = { + name = "+Debug", + b = {"DebugToggleBreakpoint", "Toggle Breakpoint"}, + c = {"DebugContinue", "Continue"}, + i = {"DebugStepInto", "Step Into"}, + o = {"DebugStepOver", "Step Over"}, + r = {"DebugToggleRepl", "Toggle Repl"}, + s = {"DebugStart", "Start"} + }, + g = { + name = "+Git", + j = {"NextHunk", "Next Hunk"}, + k = {"PrevHunk", "Prev Hunk"}, + p = {"PreviewHunk", "Preview Hunk"}, + r = {"ResetHunk", "Reset Hunk"}, + R = {"ResetBuffer", "Reset Buffer"}, + s = {"StageHunk", "Stage Hunk"}, + u = {"UndoStageHunk", "Undo Stage Hunk"} + }, + l = { + name = "+LSP", + a = {"Lspsaga code_action", "Code Action"}, + A = {"Lspsaga range_code_action", "Selected Action"}, + d = {"Telescope lsp_document_diagnostics", "Document Diagnostics"}, + D = {"Telescope lsp_workspace_diagnostics", "Workspace Diagnostics"}, + f = {"LspFormatting", "Format"}, + i = {"LspInfo", "Info"}, + l = {"Lspsaga lsp_finder", "LSP Finder"}, + L = {"Lspsaga show_line_diagnostics", "Line Diagnostics"}, + p = {"Lspsaga preview_definition", "Preview Definition"}, + q = {"Telescope quickfix", "Quickfix"}, + r = {"Lspsaga rename", "Rename"}, + t = {"LspTypeDefinition", "Type Definition"}, + x = {"cclose", "Close Quickfix"}, + s = {"Telescope lsp_document_symbols", "Document Symbols"}, + S = {"Telescope lsp_workspace_symbols", "Workspace Symbols"} + }, + + s = { + name = "+Search", + b = {"Telescope git_branches", "File"}, + c = {"Telescope colorscheme", "Colorscheme"}, + d = {"Telescope lsp_document_diagnostics", "Document Diagnostics"}, + D = {"Telescope lsp_workspace_diagnostics", "Workspace Diagnostics"}, + f = {"Telescope find_files", "Find File"}, + m = {"Telescope marks", "Marks"}, + M = {"Telescope man_pages", "Man Pages"}, + r = {"Telescope oldfiles", "Open Recent File"}, + R = {"Telescope registers", "Registers"}, + t = {"Telescope live_grep", "Text"} + }, + S = {name = "+Session", s = {"SessionSave", "Save Session"}, l = {"SessionLoad", "Load Session"}} +} + +local wk = require("which-key") +wk.register(mappings, opts) diff --git a/.config/nvim/lua/mappings.lua b/.config/nvim/lua/mappings.lua index 1233bf3..2e3eb7c 100644 --- a/.config/nvim/lua/mappings.lua +++ b/.config/nvim/lua/mappings.lua @@ -1,18 +1,10 @@ -vim.api.nvim_set_keymap('n', '', '', { noremap = true, silent = true }) -vim.g.mapleader = ' ' - --- no hl -vim.api.nvim_set_keymap('n', 'h', ':set hlsearch!', { noremap = true, silent = true }) - --- explorer -vim.api.nvim_set_keymap('n', 'e', ':NvimTreeToggle', { noremap = true, silent = true }) - +vim.api.nvim_set_keymap('n', '-', ':RnvimrToggle', {noremap = true, silent = true}) -- better window movement -vim.api.nvim_set_keymap('n', '', 'h', { silent = true }) -vim.api.nvim_set_keymap('n', '', 'j', { silent = true }) -vim.api.nvim_set_keymap('n', '', 'k', { silent = true }) -vim.api.nvim_set_keymap('n', '', 'l', { silent = true }) +vim.api.nvim_set_keymap('n', '', 'h', {silent = true}) +vim.api.nvim_set_keymap('n', '', 'j', {silent = true}) +vim.api.nvim_set_keymap('n', '', 'k', {silent = true}) +vim.api.nvim_set_keymap('n', '', 'l', {silent = true}) -- TODO fix this -- Terminal window navigation @@ -37,30 +29,24 @@ vim.cmd([[ nnoremap :vertical resize +2 ]]) - -- better indenting -vim.api.nvim_set_keymap('v', '<', '', '>gv', { noremap = true, silent = true }) +vim.api.nvim_set_keymap('v', '<', '', '>gv', {noremap = true, silent = true}) -- I hate escape -vim.api.nvim_set_keymap('i', 'jk', '', { noremap = true, silent = true }) -vim.api.nvim_set_keymap('i', 'kj', '', { noremap = true, silent = true }) -vim.api.nvim_set_keymap('i', 'jj', '', { noremap = true, silent = true }) +-- vim.api.nvim_set_keymap('i', 'jk', '', {noremap = true, silent = true}) +-- vim.api.nvim_set_keymap('i', 'kj', '', {noremap = true, silent = true}) +-- vim.api.nvim_set_keymap('i', 'jj', '', {noremap = true, silent = true}) -- Tab switch buffer -vim.api.nvim_set_keymap('n', '', ':bnext', { noremap = true, silent = true }) -vim.api.nvim_set_keymap('n', '', ':bprevious', { noremap = true, silent = true }) +vim.api.nvim_set_keymap('n', '', ':bnext', {noremap = true, silent = true}) +vim.api.nvim_set_keymap('n', '', ':bprevious', {noremap = true, silent = true}) -- Move selected line / block of text in visual mode -vim.api.nvim_set_keymap('x', 'K', ':move \'<-2gv-gv', { noremap = true, silent = true }) -vim.api.nvim_set_keymap('x', 'J', ':move \'>+1gv-gv', { noremap = true, silent = true }) - +vim.api.nvim_set_keymap('x', 'K', ':move \'<-2gv-gv', {noremap = true, silent = true}) +vim.api.nvim_set_keymap('x', 'J', ':move \'>+1gv-gv', {noremap = true, silent = true}) -- Better nav for omnicomplete vim.cmd('inoremap (\"\\\")') vim.cmd('inoremap (\"\\\")') --- vim.cmd('inoremap (\"\\\")') --- vim.cmd('inoremap (\"\\\")') --- TAB Complete ---vim.api.nvim_set_keymap('i', '', 'pumvisible() ? \"\\\" : \"\\\"', { noremap = true, silent = true }) diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua index 8663fc6..e580b55 100644 --- a/.config/nvim/lua/plugins.lua +++ b/.config/nvim/lua/plugins.lua @@ -74,6 +74,9 @@ return require("packer").startup( use {'akinsho/nvim-bufferline.lua', requires = 'kyazdani42/nvim-web-devicons'} use {"romgrk/barbar.nvim", opt = true} + -- Which key + use {"folke/which-key.nvim", opt = true} + -- Colorschemes use 'aktersnurra/githubsy.vim' use {"christianchiarulli/nvcode-color-schemes.vim", opt = true} @@ -87,10 +90,10 @@ return require("packer").startup( use 'tpope/vim-fugitive' use 'tpope/vim-rhubarb' - -- General Plugins + -- General Plugins [my own additions] use 'airblade/vim-rooter' use 'unblevable/quick-scope' - -- use 'junegunn/goyo.vim' + use 'kdav5758/TrueZen.nvim' -- use 'vimwiki/vimwiki' require_plugin("nvim-lspconfig") @@ -115,8 +118,10 @@ return require("packer").startup( require_plugin("nvim-web-devicons") require_plugin("galaxyline.nvim") require_plugin("barbar.nvim") + require_plugin("which-key.nvim") require_plugin("vim-rooter") require_plugin("quick-scope") + require_plugin("TrueZen") end ) diff --git a/.config/nvim/lua/settings.lua b/.config/nvim/lua/settings.lua index 4f06694..2cd1a40 100644 --- a/.config/nvim/lua/settings.lua +++ b/.config/nvim/lua/settings.lua @@ -8,14 +8,14 @@ vim.cmd('let &titleold="'..TERMINAL..'"') vim.o.titlestring="%<%F%=%l/%L - nvim" vim.wo.wrap = O.wrap_lines -- Display long lines as just one line vim.cmd('set whichwrap+=<,>,[,],h,l') -- move to next line with theses keys -vim.cmd('syntax on') -- move to next line with theses keys +vim.cmd('syntax on') -- syntax highlighting vim.o.pumheight = 10 -- Makes popup menu smaller vim.o.fileencoding = "utf-8" -- The encoding written to file vim.o.cmdheight = 2 -- More space for displaying messages vim.cmd('set colorcolumn=99999') -- fix indentline for now vim.o.mouse = "a" -- Enable your mouse vim.o.splitbelow = true -- Horizontal splits will automatically be below -vim.o.termguicolors = true -- set term giu colors most terminals support this +vim.o.termguicolors = true -- set term gui colors most terminals support this vim.o.splitright = true -- Vertical splits will automatically be to the right vim.o.t_Co = "256" -- Support 256 colors vim.o.conceallevel = 0 -- So that I can see `` in markdown files @@ -32,6 +32,6 @@ vim.o.backup = false -- This is recommended by coc vim.o.writebackup = false -- This is recommended by coc vim.wo.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time vim.o.updatetime = 300 -- Faster completion -vim.o.timeoutlen = 100 -- By default timeoutlen is 1000 ms +vim.o.timeoutlen = 500 -- By default timeoutlen is 1000 ms vim.o.clipboard = "unnamedplus" -- Copy paste between vim and everything else -vim.o.guifont="SpaceMono\\ Nerd\\ Font\\ Mono:h18" +vim.o.guifont = "SpaceMono Nerd Font:h17" diff --git a/.config/nvim/vim-script/_whichkey/init.vim b/.config/nvim/vim-script/_whichkey/init.vim deleted file mode 100644 index eb52b82..0000000 --- a/.config/nvim/vim-script/_whichkey/init.vim +++ /dev/null @@ -1,140 +0,0 @@ -" Leader Key Maps - -" Timeout -let g:which_key_timeout = 100 - -let g:which_key_display_names = {'': '↵', '': '⇆', " ": 'SPC'} - -" Map leader to which_key -nnoremap :silent :silent WhichKey '' -vnoremap :silent :silent WhichKeyVisual '' - -let g:which_key_map = {} -let g:which_key_sep = '→' - -" Not a fan of floating windows for this -let g:which_key_use_floating_win = 0 -let g:which_key_max_size = 0 - -" Hide status line -autocmd! FileType which_key -autocmd FileType which_key set laststatus=0 noshowmode noruler - \| autocmd BufLeave set laststatus=2 noshowmode ruler - -" let g:which_key_map['/'] = 'comment toggle' -let g:which_key_map[';'] = [ ':Dashboard' , 'home screen' ] -let g:which_key_map['?'] = [ ':NvimTreeFindFile' , 'find current file' ] -let g:which_key_map['e'] = [ ':NvimTreeToggle' , 'explorer' ] -let g:which_key_map['f'] = [ ':Telescope find_files' , 'find files' ] -let g:which_key_map['h'] = [ 's' , 'split below'] -let g:which_key_map['H'] = [ ':let @/ = ""' , 'no highlight' ] -let g:which_key_map['r'] = [ ':RnvimrToggle' , 'ranger' ] -" TODO create entire treesitter section -let g:which_key_map['v'] = [ 'v' , 'split right'] -" TODO play nice with status line - -" Group mappings - -" b is for buffer -let g:which_key_map.b = { - \ 'name' : '+buffer' , - \ '>' : [':BufferMoveNext' , 'move next'], - \ '<' : [':BufferMovePrevious' , 'move prev'], - \ 'b' : [':BufferPick' , 'pick buffer'], - \ 'd' : [':BufferClose' , 'delete-buffer'], - \ 'n' : ['bnext' , 'next-buffer'], - \ 'p' : ['bprevious' , 'previous-buffer'], - \ '?' : ['Buffers' , 'fzf-buffer'], - \ } - -" d is for debug -let g:which_key_map.d = { - \ 'name' : '+debug' , - \ 'b' : ['DebugToggleBreakpoint ' , 'toggle breakpoint'], - \ 'c' : ['DebugContinue' , 'continue'], - \ 'i' : ['DebugStepInto' , 'step into'], - \ 'o' : ['DebugStepOver' , 'step over'], - \ 'r' : ['DebugToggleRepl' , 'toggle repl'], - \ 's' : ['DebugStart' , 'start'], - \ } - -" F is for fold -let g:which_key_map.F = { - \ 'name': '+fold', - \ 'O' : [':set foldlevel=20' , 'open all'], - \ 'C' : [':set foldlevel=0' , 'close all'], - \ 'c' : [':foldclose' , 'close'], - \ 'o' : [':foldopen' , 'open'], - \ '1' : [':set foldlevel=1' , 'level1'], - \ '2' : [':set foldlevel=2' , 'level2'], - \ '3' : [':set foldlevel=3' , 'level3'], - \ '4' : [':set foldlevel=4' , 'level4'], - \ '5' : [':set foldlevel=5' , 'level5'], - \ '6' : [':set foldlevel=6' , 'level6'] - \ } - -" s is for search powered by telescope -let g:which_key_map.s = { - \ 'name' : '+search' , - \ '.' : [':Telescope filetypes' , 'filetypes'], - \ 'B' : [':Telescope git_branches' , 'git branches'], - \ 'd' : [':Telescope lsp_document_diagnostics' , 'document_diagnostics'], - \ 'D' : [':Telescope lsp_workspace_diagnostics' , 'workspace_diagnostics'], - \ 'f' : [':Telescope find_files' , 'files'], - \ 'h' : [':Telescope command_history' , 'history'], - \ 'i' : [':Telescope media_files' , 'media files'], - \ 'm' : [':Telescope marks' , 'marks'], - \ 'M' : [':Telescope man_pages' , 'man_pages'], - \ 'o' : [':Telescope vim_options' , 'vim_options'], - \ 't' : [':Telescope live_grep' , 'text'], - \ 'r' : [':Telescope registers' , 'registers'], - \ 'w' : [':Telescope file_browser' , 'buf_fuz_find'], - \ 'u' : [':Telescope colorscheme' , 'colorschemes'], - \ } - -" S is for Session -let g:which_key_map.S = { - \ 'name' : '+Session' , - \ 's' : [':SessionSave' , 'save session'], - \ 'l' : [':SessionLoad' , 'load Session'], - \ } - -" g is for git -let g:which_key_map.g = { - \ 'name' : '+git' , - \ 'b' : [':GitBlameToggle' , 'blame'], - \ 'B' : [':GBrowse' , 'browse'], - \ 'd' : [':Git diff' , 'diff'], - \ 'j' : [':NextHunk' , 'next hunk'], - \ 'k' : [':PrevHunk' , 'prev hunk'], - \ 'l' : [':Git log' , 'log'], - \ 'p' : [':PreviewHunk' , 'preview hunk'], - \ 'r' : [':ResetHunk' , 'reset hunk'], - \ 'R' : [':ResetBuffer' , 'reset buffer'], - \ 's' : [':StageHunk' , 'stage hunk'], - \ 'S' : [':Gstatus' , 'status'], - \ 'u' : [':UndoStageHunk' , 'undo stage hunk'], - \ } - -" l is for language server protocol -let g:which_key_map.l = { - \ 'name' : '+lsp' , - \ 'a' : [':Lspsaga code_action' , 'code action'], - \ 'A' : [':Lspsaga range_code_action' , 'selected action'], - \ 'd' : [':Telescope lsp_document_diagnostics' , 'document diagnostics'], - \ 'D' : [':Telescope lsp_workspace_diagnostics', 'workspace diagnostics'], - \ 'f' : [':LspFormatting' , 'format'], - \ 'I' : [':LspInfo' , 'lsp info'], - \ 'v' : [':LspVirtualTextToggle' , 'lsp toggle virtual text'], - \ 'l' : [':Lspsaga lsp_finder' , 'lsp finder'], - \ 'L' : [':Lspsaga show_line_diagnostics' , 'line_diagnostics'], - \ 'p' : [':Lspsaga preview_definition' , 'preview definition'], - \ 'q' : [':Telescope quickfix' , 'quickfix'], - \ 'r' : [':Lspsaga rename' , 'rename'], - \ 'T' : [':LspTypeDefinition' , 'type defintion'], - \ 'x' : [':cclose' , 'close quickfix'], - \ 's' : [':Telescope lsp_document_symbols' , 'document symbols'], - \ 'S' : [':Telescope lsp_workspace_symbols' , 'workspace symbols'], - \ } - -call which_key#register('', "g:which_key_map") -- cgit v1.2.3-70-g09d2