From a7e00b506d5d5fa674f37d695d50452a7ad30fe2 Mon Sep 17 00:00:00 2001 From: Stefan Imhoff Date: Sat, 17 Dec 2022 17:48:17 +0100 Subject: [PATCH] chore(nvim): simplify imports and clean up plugin files --- hammerspoon/functions.lua | 1 + nvim/after/plugin/abolish.lua | 3 + nvim/after/plugin/abolish.vim | 3 - nvim/after/plugin/alpha.lua | 8 +- nvim/after/plugin/astro.lua | 1 - nvim/after/plugin/autopairs.lua | 14 +-- nvim/after/plugin/autotag.lua | 7 +- nvim/after/plugin/blamer.lua | 4 +- nvim/after/plugin/bufferline.lua | 7 +- nvim/after/plugin/catppuccin.lua | 7 +- nvim/after/plugin/cmp.lua | 13 +-- nvim/after/plugin/codewindow.lua | 5 +- nvim/after/plugin/colorizer.lua | 25 ++--- nvim/after/plugin/comment.lua | 7 +- nvim/after/plugin/context.lua | 7 +- nvim/after/plugin/cursorline.lua | 7 +- nvim/after/plugin/dial.lua | 22 ++-- nvim/after/plugin/dressing.lua | 7 +- nvim/after/plugin/export-to-vscode.lua | 4 +- nvim/after/plugin/fzf.lua | 63 +++++------ nvim/after/plugin/git-worktree.lua | 7 +- nvim/after/plugin/gitsigns.lua | 7 +- nvim/after/plugin/glance.lua | 17 +-- nvim/after/plugin/harpoon.lua | 22 ++-- nvim/after/plugin/impatient.lua | 5 +- nvim/after/plugin/indentline.lua | 12 +-- nvim/after/plugin/legendary.lua | 12 +-- nvim/after/plugin/lualine.lua | 8 +- nvim/after/plugin/neoscroll.lua | 7 -- nvim/after/plugin/neovide.lua | 8 ++ nvim/after/plugin/neovide.vim | 8 -- nvim/after/plugin/nvim-tree.lua | 7 +- nvim/after/plugin/octo.lua | 7 +- nvim/after/plugin/project.lua | 14 +-- nvim/after/plugin/sad.lua | 7 +- nvim/after/plugin/spectre.lua | 7 +- nvim/after/plugin/surround.lua | 7 +- nvim/after/plugin/symbols-outline.lua | 7 +- nvim/after/plugin/tabular.vim | 1 - nvim/after/plugin/telescope.lua | 61 +++++------ nvim/after/plugin/todo-comments.lua | 7 +- nvim/after/plugin/toggleterm.lua | 72 ++++--------- nvim/after/plugin/treesitter.lua | 7 +- nvim/after/plugin/ufo.lua | 14 +-- nvim/after/plugin/vim-gh-line.lua | 1 - nvim/after/plugin/vimux.lua | 14 ++- nvim/after/plugin/whichkey.lua | 5 +- nvim/after/plugin/zen-mode.lua | 7 +- nvim/lua/kogakure/functions.lua | 15 ++- nvim/lua/kogakure/keymaps.lua | 141 ++++++++++++------------- nvim/lua/kogakure/plugins.lua | 3 +- 51 files changed, 245 insertions(+), 487 deletions(-) create mode 100644 nvim/after/plugin/abolish.lua delete mode 100644 nvim/after/plugin/abolish.vim delete mode 100644 nvim/after/plugin/neoscroll.lua create mode 100644 nvim/after/plugin/neovide.lua delete mode 100644 nvim/after/plugin/neovide.vim diff --git a/hammerspoon/functions.lua b/hammerspoon/functions.lua index 005b9ce..ef423e7 100644 --- a/hammerspoon/functions.lua +++ b/hammerspoon/functions.lua @@ -122,5 +122,6 @@ function ReloadConfig(files) hs.reload() end end + hs.pathwatcher.new(os.getenv("HOME") .. "/.hammerspoon/", ReloadConfig):start() hs.alert.show("Hammerspoon") diff --git a/nvim/after/plugin/abolish.lua b/nvim/after/plugin/abolish.lua new file mode 100644 index 0000000..0da2b9e --- /dev/null +++ b/nvim/after/plugin/abolish.lua @@ -0,0 +1,3 @@ +-- https://github.com/tpope/vim-abolish +vim.api.nvim_command("Abolish teh the") +vim.api.nvim_command("Abolish {despa,sepe}rat{e,es,ed,ing,ely,ion,ions,or} {despe,sepa}rat{}") diff --git a/nvim/after/plugin/abolish.vim b/nvim/after/plugin/abolish.vim deleted file mode 100644 index 8e0b164..0000000 --- a/nvim/after/plugin/abolish.vim +++ /dev/null @@ -1,3 +0,0 @@ -" https://github.com/tpope/vim-abolish -Abolish teh the -Abolish {despa,sepe}rat{e,es,ed,ing,ely,ion,ions,or} {despe,sepa}rat{} diff --git a/nvim/after/plugin/alpha.lua b/nvim/after/plugin/alpha.lua index 3328e2c..5679f8e 100644 --- a/nvim/after/plugin/alpha.lua +++ b/nvim/after/plugin/alpha.lua @@ -1,10 +1,7 @@ -- https://github.com/goolord/alpha-nvim -local status_ok, alpha = pcall(require, "alpha") -if not status_ok then - return -end - +local alpha = require("alpha") local dashboard = require("alpha.themes.dashboard") + dashboard.section.header.val = { [[🟨🟨🟨🟨🟨🟨🟨🟨]], [[🟨🟨🟨🟨🟨🟨🟨🟨]], @@ -30,7 +27,6 @@ dashboard.section.buttons.val = { dashboard.section.footer.opts.hl = "Type" dashboard.section.header.opts.hl = "Include" dashboard.section.buttons.opts.hl = "Keyword" - dashboard.opts.opts.noautocmd = true alpha.setup(dashboard.opts) diff --git a/nvim/after/plugin/astro.lua b/nvim/after/plugin/astro.lua index 217a977..492780c 100644 --- a/nvim/after/plugin/astro.lua +++ b/nvim/after/plugin/astro.lua @@ -1,3 +1,2 @@ -- https://github.com/wuelnerdotexe/vim-astro - vim.g.astro_typescript = "enable" diff --git a/nvim/after/plugin/autopairs.lua b/nvim/after/plugin/autopairs.lua index db8c70f..e8db088 100644 --- a/nvim/after/plugin/autopairs.lua +++ b/nvim/after/plugin/autopairs.lua @@ -1,10 +1,8 @@ -- https://github.com/windwp/nvim-autopairs -local status_ok, autopairs = pcall(require, "nvim-autopairs") -if not status_ok then - return -end +local cmp = require("cmp") +local cmp_autopairs = require("nvim-autopairs.completion.cmp") -autopairs.setup({ +require("nvim-autopairs").setup({ check_ts = true, ts_config = { lua = { "string", "source" }, @@ -25,10 +23,4 @@ autopairs.setup({ }, }) -local cmp_autopairs = require("nvim-autopairs.completion.cmp") -local cmp_status_ok, cmp = pcall(require, "cmp") -if not cmp_status_ok then - return -end - cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({ map_char = { tex = "" } })) diff --git a/nvim/after/plugin/autotag.lua b/nvim/after/plugin/autotag.lua index 1600e0c..5bc11fa 100644 --- a/nvim/after/plugin/autotag.lua +++ b/nvim/after/plugin/autotag.lua @@ -1,9 +1,4 @@ -- https://github.com/windwp/nvim-ts-autotag -local status_ok, autotag = pcall(require, "nvim-ts-autotag") -if not status_ok then - return -end - -autotag.setup({ +require("nvim-ts-autotag").setup({ disable_filetype = { "TelescopePrompt", "vim" }, }) diff --git a/nvim/after/plugin/blamer.lua b/nvim/after/plugin/blamer.lua index a044d18..88b3505 100644 --- a/nvim/after/plugin/blamer.lua +++ b/nvim/after/plugin/blamer.lua @@ -1,10 +1,8 @@ -- https://github.com/APZelos/blamer.nvim -local keymap = vim.keymap.set local opts = { noremap = true, silent = true } vim.g.blamer_enabled = 0 vim.g.blamer_relative_time = 1 vim.g.blamer_delay = 200 --- Keymaps -keymap("n", "tb", [[BlamerToggle]], opts) +vim.keymap.set("n", "tb", [[BlamerToggle]], opts) diff --git a/nvim/after/plugin/bufferline.lua b/nvim/after/plugin/bufferline.lua index bff84cd..b299224 100644 --- a/nvim/after/plugin/bufferline.lua +++ b/nvim/after/plugin/bufferline.lua @@ -1,10 +1,5 @@ -- https://github.com/akinsho/bufferline.nvim -local status_ok, bufferline = pcall(require, "bufferline") -if not status_ok then - return -end - -bufferline.setup({ +require("bufferline").setup({ highlights = { fill = { bg = "#282828", diff --git a/nvim/after/plugin/catppuccin.lua b/nvim/after/plugin/catppuccin.lua index 7ff6d08..0ee3d89 100644 --- a/nvim/after/plugin/catppuccin.lua +++ b/nvim/after/plugin/catppuccin.lua @@ -1,9 +1,6 @@ -- https://github.com/catppuccin/catppuccin -local status_ok, catppucin = pcall(require, "catppuccin") -if not status_ok then - return -end -vim.g.catppuccin_flavour = "mocha" -- latte, frappe, macchiato, mocha +-- latte, frappe, macchiato, mocha +vim.g.catppuccin_flavour = "mocha" require("catppuccin").setup() diff --git a/nvim/after/plugin/cmp.lua b/nvim/after/plugin/cmp.lua index bef930c..8a18c6f 100644 --- a/nvim/after/plugin/cmp.lua +++ b/nvim/after/plugin/cmp.lua @@ -1,13 +1,6 @@ -- https://github.com/hrsh7th/nvim-cmp -local cmp_status_ok, cmp = pcall(require, "cmp") -if not cmp_status_ok then - return -end - -local snip_status_ok, luasnip = pcall(require, "luasnip") -if not snip_status_ok then - return -end +local cmp = require("cmp") +local luasnip = require("luasnip") require("luasnip/loaders/from_vscode").lazy_load() @@ -16,7 +9,6 @@ local check_backspace = function() return col == 0 or vim.fn.getline("."):sub(col, col):match("%s") end ---   ο­„ ﯟ  ο™± some other good icons local kind_icons = { Text = "", Method = "m", @@ -45,7 +37,6 @@ local kind_icons = { TypeParameter = "οžƒ", Octoface = "", } --- find more here: https://www.nerdfonts.com/cheat-sheet cmp.setup({ snippet = { diff --git a/nvim/after/plugin/codewindow.lua b/nvim/after/plugin/codewindow.lua index 21680b0..f870591 100644 --- a/nvim/after/plugin/codewindow.lua +++ b/nvim/after/plugin/codewindow.lua @@ -1,8 +1,5 @@ -- https://github.com/gorbit99/codewindow.nvim -local status, codewindow = pcall(require, "codewindow") -if not status then - return -end +local codewindow = require("codewindow") codewindow.setup() diff --git a/nvim/after/plugin/colorizer.lua b/nvim/after/plugin/colorizer.lua index dce32f0..8dcb94d 100644 --- a/nvim/after/plugin/colorizer.lua +++ b/nvim/after/plugin/colorizer.lua @@ -1,10 +1,5 @@ -- https://github.com/norcalli/nvim-colorizer.lua -local status, colorizer = pcall(require, "colorizer") -if not status then - return -end - -colorizer.setup({ +require("colorizer").setup({ "css", "html", "javascript", @@ -12,13 +7,13 @@ colorizer.setup({ "typescript", "typescriptreact", }, { - RGB = true, -- #RGB hex codes - RRGGBB = true, -- #RRGGBB hex codes - names = true, -- "Name" codes like Blue - RRGGBBAA = true, -- #RRGGBBAA hex codes - rgb_fn = true, -- CSS rgb() and rgba() functions - hsl_fn = true, -- CSS hsl() and hsla() functions - css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB - css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn - mode = "background", -- Set the display mode.) + RGB = true, + RRGGBB = true, + names = true, + RRGGBBAA = true, + rgb_fn = true, + hsl_fn = true, + css = true, + css_fn = true, + mode = "background", }) diff --git a/nvim/after/plugin/comment.lua b/nvim/after/plugin/comment.lua index 3834a05..fe990b0 100644 --- a/nvim/after/plugin/comment.lua +++ b/nvim/after/plugin/comment.lua @@ -1,10 +1,5 @@ -- https://github.com/numToStr/comment.nvim -local status_ok, comment = pcall(require, "Comment") -if not status_ok then - return -end - -comment.setup({ +require("Comment").setup({ pre_hook = function(ctx) local U = require("Comment.utils") diff --git a/nvim/after/plugin/context.lua b/nvim/after/plugin/context.lua index 4c72ef8..094c1e2 100644 --- a/nvim/after/plugin/context.lua +++ b/nvim/after/plugin/context.lua @@ -1,10 +1,5 @@ -- https://github.com/nvim-treesitter/nvim-treesitter-context -local status_ok, context = pcall(require, "treesitter-context") -if not status_ok then - return -end - -context.setup({ +require("treesitter-context").setup({ patterns = { default = { "class", diff --git a/nvim/after/plugin/cursorline.lua b/nvim/after/plugin/cursorline.lua index b2d81e6..e073e49 100644 --- a/nvim/after/plugin/cursorline.lua +++ b/nvim/after/plugin/cursorline.lua @@ -1,10 +1,5 @@ -- https://github.com/yamatsum/nvim-cursorline -local status, cursorline = pcall(require, "nvim-cursorline") -if not status then - return -end - -cursorline.setup({ +require("nvim-cursorline").setup({ cursorline = { enable = true, timeout = 1000, diff --git a/nvim/after/plugin/dial.lua b/nvim/after/plugin/dial.lua index 315aec4..ae40105 100644 --- a/nvim/after/plugin/dial.lua +++ b/nvim/after/plugin/dial.lua @@ -1,10 +1,5 @@ --- https://github.com/karb94/neoscroll.nvim -local status, augend = pcall(require, "dial.augend") -if not status then - return -end - -local keymap = vim.keymap.set +-- https://github.com/monaqa/dial.nvim +local augend = require("dial.augend") local opts = { noremap = true, silent = true } require("dial.config").augends:register_group({ @@ -19,10 +14,9 @@ require("dial.config").augends:register_group({ }, }) --- Keymaps -keymap("n", "", require("dial.map").inc_normal(), opts) -keymap("n", "", require("dial.map").dec_normal(), opts) -keymap("v", "", require("dial.map").inc_visual(), opts) -keymap("v", "", require("dial.map").dec_visual(), opts) -keymap("v", "g", require("dial.map").inc_gvisual(), opts) -keymap("v", "g", require("dial.map").dec_gvisual(), opts) +vim.keymap.set("n", "", require("dial.map").inc_normal(), opts) +vim.keymap.set("n", "", require("dial.map").dec_normal(), opts) +vim.keymap.set("v", "", require("dial.map").inc_visual(), opts) +vim.keymap.set("v", "", require("dial.map").dec_visual(), opts) +vim.keymap.set("v", "g", require("dial.map").inc_gvisual(), opts) +vim.keymap.set("v", "g", require("dial.map").dec_gvisual(), opts) diff --git a/nvim/after/plugin/dressing.lua b/nvim/after/plugin/dressing.lua index a959657..b1672e5 100644 --- a/nvim/after/plugin/dressing.lua +++ b/nvim/after/plugin/dressing.lua @@ -1,7 +1,2 @@ -- https://github.com/stevearc/dressing.nvim -local status, dressing = pcall(require, "dressing") -if not status then - return -end - -dressing.setup() +require("dressing").setup() diff --git a/nvim/after/plugin/export-to-vscode.lua b/nvim/after/plugin/export-to-vscode.lua index 00daf43..b3356da 100644 --- a/nvim/after/plugin/export-to-vscode.lua +++ b/nvim/after/plugin/export-to-vscode.lua @@ -1,6 +1,4 @@ --- https://github.com/elijahmanor/export-to-vscode.nvim -local keymap = vim.keymap.set local opts = { noremap = true, silent = true } --- Keymaps -keymap("n", "code", [[lua require("export-to-vscode").launch()]], opts) +vim.keymap.set("n", "code", [[lua require("export-to-vscode").launch()]], opts) diff --git a/nvim/after/plugin/fzf.lua b/nvim/after/plugin/fzf.lua index fb25bf0..7db21c6 100644 --- a/nvim/after/plugin/fzf.lua +++ b/nvim/after/plugin/fzf.lua @@ -1,44 +1,35 @@ -- https://github.com/ibhagwan/fzf-lua -local cmp_status_ok, fzf_lua = pcall(require, "fzf-lua") -if not cmp_status_ok then - return -end - -local keymap = vim.keymap.set local opts = { noremap = true, silent = true } -fzf_lua.setup({ +require("fzf-lua").setup({ lsp = { async_or_timeout = 3000, -- make lsp requests synchronous so they work with null-ls }, }) --- Keymaps --- keymap("n", "", [[:FzfLua files]], opts) --- keymap("n", "b", [[:FzfLua buffers]], opts) -keymap("n", "zbl", [[FzfLua blines]], opts) -keymap("n", "zf", [[FzfLua files]], opts) -keymap("n", "zg", [[FzfLua grep]], opts) -keymap("n", "zgb", [[FzfLua git_branches]], opts) -keymap("n", "zgc", [[FzfLua git_commits]], opts) -keymap("n", "zgl", [[FzfLua grep_last]], opts) -keymap("n", "zgp", [[FzfLua grep_project]], opts) -keymap("n", "zgs", [[FzfLua git_status]], opts) -keymap("n", "zgst", [[FzfLua git_stash]], opts) -keymap("n", "zgv", [[FzfLua grep_visual]], opts) -keymap("n", "zgw", [[FzfLua grep_cword]], opts) -keymap("n", "zh", [[FzfLua oldfiles]], opts) -keymap("n", "zl", [[FzfLua lines]], opts) -keymap("n", "zlca", [[FzfLua code_actions]], opts) -keymap("n", "zld", [[FzfLua lsp_definitions]], opts) -keymap("n", "zlds", [[FzfLua lsp_document_symbols]], opts) -keymap("n", "zlg", [[FzfLua live_grep]], opts) -keymap("n", "zlgr", [[FzfLua live_grep_resume]], opts) -keymap("n", "zlr", [[FzfLua lsp_references]], opts) -keymap("n", "zltd", [[FzfLua lsp_typedef]], opts) -keymap("n", "zlws", [[FzfLua lsp_live_workspace_symbols]], opts) -keymap("n", "zm", [[FzfLua marks]], opts) -keymap("n", "zqfq", [[FzfLua quickfix]], opts) -keymap("n", "zr", [[FzfLua resume]], opts) -keymap("n", "zss", [[FzfLua spell_suggest]], opts) -keymap("n", "ztg", [[FzfLua tabs]], opts) +vim.keymap.set("n", "zbl", [[FzfLua blines]], opts) +vim.keymap.set("n", "zf", [[FzfLua Files]], opts) +vim.keymap.set("n", "zg", [[FzfLua Grep]], opts) +vim.keymap.set("n", "zgb", [[FzfLua git_branches]], opts) +vim.keymap.set("n", "zgc", [[FzfLua git_commits]], opts) +vim.keymap.set("n", "zgl", [[FzfLua grep_last]], opts) +vim.keymap.set("n", "zgp", [[FzfLua grep_project]], opts) +vim.keymap.set("n", "zgs", [[FzfLua git_status]], opts) +vim.keymap.set("n", "zgst", [[FzfLua git_stash]], opts) +vim.keymap.set("n", "zgv", [[FzfLua grep_visual]], opts) +vim.keymap.set("n", "zgw", [[FzfLua grep_cword]], opts) +vim.keymap.set("n", "zh", [[FzfLua oldfiles]], opts) +vim.keymap.set("n", "zl", [[FzfLua lines]], opts) +vim.keymap.set("n", "zlca", [[FzfLua code_actions]], opts) +vim.keymap.set("n", "zld", [[FzfLua lsp_definitions]], opts) +vim.keymap.set("n", "zlds", [[FzfLua lsp_document_symbols]], opts) +vim.keymap.set("n", "zlg", [[FzfLua live_grep]], opts) +vim.keymap.set("n", "zlgr", [[FzfLua live_grep_resume]], opts) +vim.keymap.set("n", "zlr", [[FzfLua lsp_references]], opts) +vim.keymap.set("n", "zltd", [[FzfLua lsp_typedef]], opts) +vim.keymap.set("n", "zlws", [[FzfLua lsp_live_workspace_symbols]], opts) +vim.keymap.set("n", "zm", [[FzfLua marks]], opts) +vim.keymap.set("n", "zqfq", [[FzfLua quickfix]], opts) +vim.keymap.set("n", "zr", [[FzfLua resume]], opts) +vim.keymap.set("n", "zss", [[FzfLua spell_suggest]], opts) +vim.keymap.set("n", "ztg", [[FzfLua tabs]], opts) diff --git a/nvim/after/plugin/git-worktree.lua b/nvim/after/plugin/git-worktree.lua index e1ca0c0..1365bb5 100644 --- a/nvim/after/plugin/git-worktree.lua +++ b/nvim/after/plugin/git-worktree.lua @@ -1,9 +1,4 @@ -- https://github.com/ThePrimeagen/git-worktree.nvim -local cmp_status_ok, worktree = pcall(require, "git-worktree") -if not cmp_status_ok then - return -end - vim.g.git_worktree_log_level = "error" -worktree.setup() +require("git-worktree").setup() diff --git a/nvim/after/plugin/gitsigns.lua b/nvim/after/plugin/gitsigns.lua index 52dd1e6..6edf98e 100644 --- a/nvim/after/plugin/gitsigns.lua +++ b/nvim/after/plugin/gitsigns.lua @@ -1,10 +1,5 @@ -- https://github.com/lewis6991/gitsigns.nvim -local status_ok, gitsigns = pcall(require, "gitsigns") -if not status_ok then - return -end - -gitsigns.setup({ +require("gitsigns").setup({ signs = { add = { hl = "GitSignsAdd", text = "β–Ž", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" }, change = { hl = "GitSignsChange", text = "β–Ž", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" }, diff --git a/nvim/after/plugin/glance.lua b/nvim/after/plugin/glance.lua index f5f8130..64a19d4 100644 --- a/nvim/after/plugin/glance.lua +++ b/nvim/after/plugin/glance.lua @@ -1,16 +1,9 @@ -- https://github.com/DNLHC/glance.nvim -local status_ok, glance = pcall(require, "glance") -if not status_ok then - return -end - -local keymap = vim.keymap.set local opts = { noremap = true, silent = true } -glance.setup() +vim.keymap.set("n", "gld", "Glance definitions", opts) +vim.keymap.set("n", "gli", "Glance implementations", opts) +vim.keymap.set("n", "glr", "Glance references", opts) +vim.keymap.set("n", "glt", "Glance type_definitions", opts) --- Keymaps -keymap("n", "gld", "Glance definitions", opts) -keymap("n", "gli", "Glance implementations", opts) -keymap("n", "glr", "Glance references", opts) -keymap("n", "glt", "Glance type_definitions", opts) +require("glance").setup() diff --git a/nvim/after/plugin/harpoon.lua b/nvim/after/plugin/harpoon.lua index 2c30e82..0d5c1a1 100644 --- a/nvim/after/plugin/harpoon.lua +++ b/nvim/after/plugin/harpoon.lua @@ -1,18 +1,12 @@ -- https://github.com/ThePrimeagen/harpoon -local status, harpoon = pcall(require, "harpoon") -if not status then - return -end - -local keymap = vim.keymap.set +local harpoon = require("harpoon") local opts = { noremap = true, silent = true } -harpoon.setup() +vim.keymap.set("n", "a", [[lua require("harpoon.mark").add_file()]], opts) +vim.keymap.set("n", ",", [[lua require("harpoon.ui").toggle_quick_menu()]], opts) +vim.keymap.set("n", "1", [[lua require("harpoon.ui").nav_file(1)]], opts) +vim.keymap.set("n", "2", [[lua require("harpoon.ui").nav_file(2)]], opts) +vim.keymap.set("n", "3", [[lua require("harpoon.ui").nav_file(3)]], opts) +vim.keymap.set("n", "4", [[lua require("harpoon.ui").nav_file(4)]], opts) --- Keymaps -keymap("n", "a", [[lua require("harpoon.mark").add_file()]], opts) -keymap("n", ",", [[lua require("harpoon.ui").toggle_quick_menu()]], opts) -keymap("n", "1", [[lua require("harpoon.ui").nav_file(1)]], opts) -keymap("n", "2", [[lua require("harpoon.ui").nav_file(2)]], opts) -keymap("n", "3", [[lua require("harpoon.ui").nav_file(3)]], opts) -keymap("n", "4", [[lua require("harpoon.ui").nav_file(4)]], opts) +harpoon.setup() diff --git a/nvim/after/plugin/impatient.lua b/nvim/after/plugin/impatient.lua index 1132d9b..198e830 100644 --- a/nvim/after/plugin/impatient.lua +++ b/nvim/after/plugin/impatient.lua @@ -1,7 +1,4 @@ -- https://github.com/lewis6991/impatient.nvim -local status_ok, impatient = pcall(require, "impatient") -if not status_ok then - return -end +local impatient = require("impatient") impatient.enable_profile() diff --git a/nvim/after/plugin/indentline.lua b/nvim/after/plugin/indentline.lua index bd065a7..ece5e04 100644 --- a/nvim/after/plugin/indentline.lua +++ b/nvim/after/plugin/indentline.lua @@ -1,14 +1,10 @@ -- https://github.com/lukas-reineke/indent-blankline.nvim -local status_ok, indent_blankline = pcall(require, "indent_blankline") -if not status_ok then - return -end +local indent_blankline = require("indent_blankline") vim.opt.termguicolors = true -vim.cmd([[ -highlight IndentBlanklineIndent1 guibg=#1f1f1f gui=nocombine -highlight IndentBlanklineIndent2 guibg=#1a1a1a gui=nocombine -]]) + +vim.api.nvim_set_hl(0, "IndentBlanklineIndent1", { bg = "#1f1f1f", nocombine = true }) +vim.api.nvim_set_hl(0, "IndentBlanklineIndent2", { bg = "#1a1a1a", nocombine = true }) indent_blankline.setup({ char = "", diff --git a/nvim/after/plugin/legendary.lua b/nvim/after/plugin/legendary.lua index e93a7fc..6147d84 100644 --- a/nvim/after/plugin/legendary.lua +++ b/nvim/after/plugin/legendary.lua @@ -1,13 +1,7 @@ -- https://github.com/mrjones2014/legendary.nvim -local status, legendary = pcall(require, "legendary") -if not status then - return -end - -local keymap = vim.keymap.set +local legendary = require("legendary") local opts = { noremap = true, silent = true } -legendary.setup({ which_key = { auto_register = true } }) +vim.keymap.set("n", "LL", "Legendary", opts) --- Keymaps -keymap("n", "LL", "Legendary", opts) +legendary.setup({ which_key = { auto_register = true } }) diff --git a/nvim/after/plugin/lualine.lua b/nvim/after/plugin/lualine.lua index 75dd99c..fee4d42 100644 --- a/nvim/after/plugin/lualine.lua +++ b/nvim/after/plugin/lualine.lua @@ -1,13 +1,7 @@ -- https://github.com/nvim-lualine/lualine.nvim -local status, lualine = pcall(require, "lualine") -if not status then - return -end - -lualine.setup({ +require("lualine").setup({ options = { icons_enabled = true, - --[[ theme = "onedark", ]] theme = "tokyonight", component_separators = { left = "ξ‚±", right = "ξ‚³" }, section_separators = { left = "ξ‚°", right = "ξ‚²" }, diff --git a/nvim/after/plugin/neoscroll.lua b/nvim/after/plugin/neoscroll.lua deleted file mode 100644 index 5661424..0000000 --- a/nvim/after/plugin/neoscroll.lua +++ /dev/null @@ -1,7 +0,0 @@ --- https://github.com/karb94/neoscroll.nvim -local status, neoscroll = pcall(require, "neoscroll") -if not status then - return -end - ---[[ neoscroll.setup() ]] diff --git a/nvim/after/plugin/neovide.lua b/nvim/after/plugin/neovide.lua new file mode 100644 index 0000000..b34b407 --- /dev/null +++ b/nvim/after/plugin/neovide.lua @@ -0,0 +1,8 @@ +-- https://github.com/neovide/neovide +if vim.fn.exists("g:neovide") then + vim.o.guifont = "FiraCode Nerd Font:h20" + + vim.g.neovide_cursor_vfx_mode = "railgun" + vim.g.neovide_floating_blur_amount_x = 2.0 + vim.g.neovide_floating_blur_amount_y = 2.0 +end diff --git a/nvim/after/plugin/neovide.vim b/nvim/after/plugin/neovide.vim deleted file mode 100644 index 7d0157f..0000000 --- a/nvim/after/plugin/neovide.vim +++ /dev/null @@ -1,8 +0,0 @@ -" https://github.com/neovide/neovide -if exists("g:neovide") - set guifont=FiraCode\ Nerd\ Font:h20 - - let g:neovide_cursor_vfx_mode = "railgun" - let g:neovide_floating_blur_amount_x = 2.0 - let g:neovide_floating_blur_amount_y = 2.0 -endif diff --git a/nvim/after/plugin/nvim-tree.lua b/nvim/after/plugin/nvim-tree.lua index 10ee8c7..2e41836 100644 --- a/nvim/after/plugin/nvim-tree.lua +++ b/nvim/after/plugin/nvim-tree.lua @@ -1,10 +1,5 @@ -- https://github.com/kyazdani42/nvim-tree.lua -local status_ok, nvim_tree = pcall(require, "nvim-tree") -if not status_ok then - return -end - -nvim_tree.setup({ +require("nvim-tree").setup({ update_focused_file = { enable = true, update_root = true, diff --git a/nvim/after/plugin/octo.lua b/nvim/after/plugin/octo.lua index 6a13ec0..eec6a9d 100644 --- a/nvim/after/plugin/octo.lua +++ b/nvim/after/plugin/octo.lua @@ -1,7 +1,2 @@ -- https://github.com/pwntester/octo.nvim -local status_ok, octo = pcall(require, "octo") -if not status_ok then - return -end - -octo.setup() +require("octo").setup() diff --git a/nvim/after/plugin/project.lua b/nvim/after/plugin/project.lua index 1dadf47..98fc2b7 100644 --- a/nvim/after/plugin/project.lua +++ b/nvim/after/plugin/project.lua @@ -1,10 +1,9 @@ -- https://github.com/ahmedkhalf/project.nvim -local status_ok, project = pcall(require, "project_nvim") -if not status_ok then - return -end +local opts = { noremap = true, silent = true } -project.setup({ +vim.keymap.set("n", "pm", [[:Telescope projects]], opts) + +require("project_nvim").setup({ active = true, on_config_done = nil, manual_mode = false, @@ -23,8 +22,3 @@ project.setup({ ignore_lsp = {}, datapath = vim.fn.stdpath("data"), }) - -local keymap = vim.keymap.set -local opts = { noremap = true, silent = true } - -keymap("n", "pm", [[:Telescope projects]], opts) diff --git a/nvim/after/plugin/sad.lua b/nvim/after/plugin/sad.lua index 400319a..b5c46f4 100644 --- a/nvim/after/plugin/sad.lua +++ b/nvim/after/plugin/sad.lua @@ -1,10 +1,5 @@ -- https://github.com/ray-x/sad.nvim -local status_ok, sad = pcall(require, "sad") -if not status_ok then - return -end - -sad.setup({ +require("sad").setup({ diff = "delta", -- you can use `diff`, `diff-so-fancy` ls_file = "fd", -- also git ls_file exact = false, -- exact match diff --git a/nvim/after/plugin/spectre.lua b/nvim/after/plugin/spectre.lua index e645680..66a01b4 100644 --- a/nvim/after/plugin/spectre.lua +++ b/nvim/after/plugin/spectre.lua @@ -1,7 +1,2 @@ -- https://github.com/nvim-pack/nvim-spectre -local status_ok, spectre = pcall(require, "spectre") -if not status_ok then - return -end - -spectre.setup() +require("spectre").setup() diff --git a/nvim/after/plugin/surround.lua b/nvim/after/plugin/surround.lua index 595f50d..70f5df2 100644 --- a/nvim/after/plugin/surround.lua +++ b/nvim/after/plugin/surround.lua @@ -1,7 +1,2 @@ -- https://github.com/kylechui/nvim-surround -local status_ok, surround = pcall(require, "nvim-surround") -if not status_ok then - return -end - -surround.setup() +require("nvim-surround").setup() diff --git a/nvim/after/plugin/symbols-outline.lua b/nvim/after/plugin/symbols-outline.lua index 4471017..287372f 100644 --- a/nvim/after/plugin/symbols-outline.lua +++ b/nvim/after/plugin/symbols-outline.lua @@ -1,9 +1,4 @@ -- https://github.com/simrat39/symbols-outline.nvim -local status_ok, outline = pcall(require, "symbols-outline") -if not status_ok then - return -end - -outline.setup({ +require("symbols-outline").setup({ width = 25, }) diff --git a/nvim/after/plugin/tabular.vim b/nvim/after/plugin/tabular.vim index 5a13027..24ca6e5 100644 --- a/nvim/after/plugin/tabular.vim +++ b/nvim/after/plugin/tabular.vim @@ -6,7 +6,6 @@ AddTabularPattern! ruby_hash /^[^=>]*\zs=>/ AddTabularPattern! commas /,\s*\zs\s/l0 AddTabularPattern! colons /^[^:]*:\s*\zs\s/l0 -" Mappings inoremap :call align()a " Automatic Tabular.vim with the (|) diff --git a/nvim/after/plugin/telescope.lua b/nvim/after/plugin/telescope.lua index 6503063..bbedd70 100644 --- a/nvim/after/plugin/telescope.lua +++ b/nvim/after/plugin/telescope.lua @@ -1,15 +1,33 @@ -- https://github.com/nvim-telescope/telescope.nvim/ -local status_ok, telescope = pcall(require, "telescope") -if not status_ok then - return -end - -local keymap = vim.keymap.set +local telescope = require("telescope") +local actions = require("telescope.actions") local opts = { noremap = true, silent = true } -local actions = require("telescope.actions") +vim.keymap.set("n", "", [[Telescope find_files]], opts) +vim.keymap.set("n", "C", [[Cheatsheet]], opts) +vim.keymap.set("n", "F", [[Telescope live_grep]], opts) +vim.keymap.set("n", "H", [[Telescope headings]], opts) +vim.keymap.set("n", "S", [[Telescope spell_suggest]], opts) +vim.keymap.set("n", "b", [[Telescope buffers]], opts) +vim.keymap.set("n", "bm", [[Telescope bookmarks]], opts) +vim.keymap.set("n", "f", [[Telescope current_buffer_fuzzy_find]], opts) +vim.keymap.set("n", "fa", [[Telescope find_files hidden=true]], opts) +vim.keymap.set("n", "fb", [[Telescope file_browser]], opts) +vim.keymap.set("n", "fd", [[Telescope dir live_grep]], opts) +vim.keymap.set("n", "ff", [[Telescope dir find_files]], opts) +vim.keymap.set("n", "gb", [[Telescope git_branches]], opts) +vim.keymap.set("n", "gs", [[Telescope git_status]], opts) +vim.keymap.set("n", "gwc", [[Telescope git_worktree create_git_worktree]], opts) +vim.keymap.set("n", "gww", [[Telescope git_worktree git_worktrees]], opts) +vim.keymap.set("n", "ht", [[Telescope help_tags]], opts) +vim.keymap.set("n", "km", [[Telescope keymaps]], opts) +vim.keymap.set("n", "m", [[Telescope marks]], opts) +vim.keymap.set("n", "mru", [[Telescope frecency]], opts) +vim.keymap.set("n", "nm", [[Telescope node_modules list]], opts) +vim.keymap.set("n", "r", [[Telescope resume]], opts) +vim.keymap.set("n", "tg", [[Telescope tags]], opts) +vim.keymap.set("n", "ty", [[Telescope symbols]], opts) --- Extensions telescope.load_extension("bookmarks") telescope.load_extension("node_modules") telescope.load_extension("file_browser") @@ -23,33 +41,6 @@ telescope.load_extension("gh") telescope.load_extension("git_worktree") telescope.load_extension("dir") --- Keymaps -keymap("n", "", [[Telescope find_files]], opts) -keymap("n", "C", [[Cheatsheet]], opts) -keymap("n", "F", [[Telescope live_grep]], opts) -keymap("n", "H", [[Telescope headings]], opts) -keymap("n", "S", [[Telescope spell_suggest]], opts) -keymap("n", "b", [[Telescope buffers]], opts) -keymap("n", "bm", [[Telescope bookmarks]], opts) -keymap("n", "f", [[Telescope current_buffer_fuzzy_find]], opts) -keymap("n", "fa", [[Telescope find_files hidden=true]], opts) -keymap("n", "fb", [[Telescope file_browser]], opts) -keymap("n", "fd", [[Telescope dir live_grep]], opts) -keymap("n", "ff", [[Telescope dir find_files]], opts) -keymap("n", "gb", [[Telescope git_branches]], opts) -keymap("n", "gs", [[Telescope git_status]], opts) -keymap("n", "gwc", [[Telescope git_worktree create_git_worktree]], opts) -keymap("n", "gww", [[Telescope git_worktree git_worktrees]], opts) -keymap("n", "ht", [[Telescope help_tags]], opts) -keymap("n", "km", [[Telescope keymaps]], opts) -keymap("n", "m", [[Telescope marks]], opts) -keymap("n", "mru", [[Telescope frecency]], opts) -keymap("n", "nm", [[Telescope node_modules list]], opts) -keymap("n", "r", [[Telescope resume]], opts) -keymap("n", "tg", [[Telescope tags]], opts) -keymap("n", "ty", [[Telescope symbols]], opts) - --- Setup telescope.setup({ defaults = { prompt_prefix = "ο‘« ", diff --git a/nvim/after/plugin/todo-comments.lua b/nvim/after/plugin/todo-comments.lua index 08bcbe7..de52ea9 100644 --- a/nvim/after/plugin/todo-comments.lua +++ b/nvim/after/plugin/todo-comments.lua @@ -1,7 +1,2 @@ -- https://github.com/folke/todo-comments.nvim -local status_ok, todo = pcall(require, "todo-comments") -if not status_ok then - return -end - -todo.setup() +require("todo-comments").setup() diff --git a/nvim/after/plugin/toggleterm.lua b/nvim/after/plugin/toggleterm.lua index 8218edd..361bfb0 100644 --- a/nvim/after/plugin/toggleterm.lua +++ b/nvim/after/plugin/toggleterm.lua @@ -1,8 +1,17 @@ -- https://github.com/akinsho/toggleterm.nvim -local status_ok, toggleterm = pcall(require, "toggleterm") -if not status_ok then - return -end +local toggleterm = require("toggleterm") +local Terminal = require("toggleterm.terminal").Terminal +local opts = { noremap = true, silent = true } + +-- Keymaps +vim.keymap.set("n", "", "lua _LAZYGIT_TOGGLE()", opts) +vim.keymap.set("n", "", "lua _RANGER_TOGGLE()", opts) +vim.keymap.set("n", "lg", "lua _LAZYGIT_TOGGLE()", opts) +vim.keymap.set("n", "ncdu", "lua _NCDU_TOGGLE()", opts) +vim.keymap.set("n", "node", "lua _NODE_TOGGLE()", opts) +vim.keymap.set("n", "rg", "lua _RANGER_TOGGLE()", opts) +vim.keymap.set("n", "top", "lua _HTOP_TOGGLE()", opts) +vim.keymap.set("n", "y", "lua _PYTHON_TOGGLE()", opts) toggleterm.setup({ size = 20, @@ -42,16 +51,13 @@ end vim.cmd("autocmd! TermOpen term://* lua set_terminal_keymaps()") -local Terminal = require("toggleterm.terminal").Terminal -local lazygit = Terminal:new({ - cmd = "lazygit", - hidden = true, -}) - -local ranger = Terminal:new({ - cmd = "ranger", - hidden = true, -}) +local lazygit = Terminal:new({ cmd = "lazygit", hidden = true }) +local ranger = Terminal:new({ cmd = "ranger", hidden = true }) +local tig = Terminal:new({ cmd = "tig", hidden = true }) +local node = Terminal:new({ cmd = "node", hidden = true }) +local ncdu = Terminal:new({ cmd = "ncdu", hidden = true }) +local htop = Terminal:new({ cmd = "htop", hidden = true }) +local python = Terminal:new({ cmd = "python", hidden = true }) function _LAZYGIT_TOGGLE() lazygit:toggle() @@ -61,60 +67,22 @@ function _RANGER_TOGGLE() ranger:toggle() end -local tig = Terminal:new({ - cmd = "tig", - hidden = true, -}) - function _TIG_TOGGLE() tig:toggle() end -local node = Terminal:new({ - cmd = "node", - hidden = true, -}) - function _NODE_TOGGLE() node:toggle() end -local ncdu = Terminal:new({ - cmd = "ncdu", - hidden = true, -}) - function _NCDU_TOGGLE() ncdu:toggle() end -local htop = Terminal:new({ - cmd = "htop", - hidden = true, -}) - function _HTOP_TOGGLE() htop:toggle() end -local python = Terminal:new({ - cmd = "python", - hidden = true, -}) - function _PYTHON_TOGGLE() python:toggle() end - -local keymap = vim.keymap.set -local opts = { noremap = true, silent = true } - --- Keymaps -keymap("n", "", "lua _LAZYGIT_TOGGLE()", opts) -keymap("n", "", "lua _RANGER_TOGGLE()", opts) -keymap("n", "lg", "lua _LAZYGIT_TOGGLE()", opts) -keymap("n", "ncdu", "lua _NCDU_TOGGLE()", opts) -keymap("n", "node", "lua _NODE_TOGGLE()", opts) -keymap("n", "rg", "lua _RANGER_TOGGLE()", opts) -keymap("n", "top", "lua _HTOP_TOGGLE()", opts) -keymap("n", "y", "lua _PYTHON_TOGGLE()", opts) diff --git a/nvim/after/plugin/treesitter.lua b/nvim/after/plugin/treesitter.lua index 5ae06b4..6411393 100644 --- a/nvim/after/plugin/treesitter.lua +++ b/nvim/after/plugin/treesitter.lua @@ -1,10 +1,5 @@ -- https://github.com/nvim-treesitter/nvim-treesitter/ -local status_ok, configs = pcall(require, "nvim-treesitter.configs") -if not status_ok then - return -end - -configs.setup({ +require("nvim-treesitter.configs").setup({ ensure_installed = "all", sync_install = false, ignore_install = { "" }, -- List of parsers to ignore installing diff --git a/nvim/after/plugin/ufo.lua b/nvim/after/plugin/ufo.lua index 9aa40b1..a15b586 100644 --- a/nvim/after/plugin/ufo.lua +++ b/nvim/after/plugin/ufo.lua @@ -1,20 +1,12 @@ -- https://github.com/kevinhwang91/nvim-ufo -local status_ok, ufo = pcall(require, "ufo") -if not status_ok then - return -end - -local keymap = vim.keymap.set local opts = { noremap = true, silent = true } --- Options vim.o.foldcolumn = "1" vim.o.foldlevel = 99 vim.o.foldlevelstart = 99 vim.o.foldenable = true -ufo.setup() +vim.keymap.set("n", "zR", require("ufo").openAllFolds, opts) +vim.keymap.set("n", "zM", require("ufo").closeAllFolds, opts) --- Keymaps -keymap("n", "zR", require("ufo").openAllFolds, opts) -keymap("n", "zM", require("ufo").closeAllFolds, opts) +require("ufo").setup() diff --git a/nvim/after/plugin/vim-gh-line.lua b/nvim/after/plugin/vim-gh-line.lua index 3349e3d..c3425e0 100644 --- a/nvim/after/plugin/vim-gh-line.lua +++ b/nvim/after/plugin/vim-gh-line.lua @@ -1,3 +1,2 @@ -- https://github.com/ruanyl/vim-gh-line - vim.g.gh_github_domain = "source.xing.com" diff --git a/nvim/after/plugin/vimux.lua b/nvim/after/plugin/vimux.lua index 3ab4145..5835c3f 100644 --- a/nvim/after/plugin/vimux.lua +++ b/nvim/after/plugin/vimux.lua @@ -1,15 +1,13 @@ -- https://github.com/preservim/vimux -local keymap = vim.keymap.set local opts = { noremap = true, silent = true } vim.g.VimuxHeight = "30" vim.g.VimuxOrientation = "h" vim.g.VimuxUseNearestPane = 0 --- Keymaps -keymap("n", "vt", [[VimuxTogglePane]], opts) -keymap("n", "vp", [[VimuxPromptCommand]], opts) -keymap("n", "vl", [[VimuxRunLastCommand]], opts) -keymap("n", "vj", [[RunJest]], opts) -keymap("n", "vjb", [[RunJestOnBuffer]], opts) -keymap("n", "vjf", [[RunJestFocused]], opts) +vim.keymap.set("n", "vt", [[VimuxTogglePane]], opts) +vim.keymap.set("n", "vp", [[VimuxPromptCommand]], opts) +vim.keymap.set("n", "vl", [[VimuxRunLastCommand]], opts) +vim.keymap.set("n", "vj", [[RunJest]], opts) +vim.keymap.set("n", "vjb", [[RunJestOnBuffer]], opts) +vim.keymap.set("n", "vjf", [[RunJestFocused]], opts) diff --git a/nvim/after/plugin/whichkey.lua b/nvim/after/plugin/whichkey.lua index c14f888..fe66358 100644 --- a/nvim/after/plugin/whichkey.lua +++ b/nvim/after/plugin/whichkey.lua @@ -1,8 +1,5 @@ -- https://github.com/folke/which-key.nvim -local status_ok, which_key = pcall(require, "which-key") -if not status_ok then - return -end +local which_key = require("which-key") local mappings = { b = { "Telescope buffers", "Buffers" }, diff --git a/nvim/after/plugin/zen-mode.lua b/nvim/after/plugin/zen-mode.lua index bf5acb3..575853e 100644 --- a/nvim/after/plugin/zen-mode.lua +++ b/nvim/after/plugin/zen-mode.lua @@ -1,10 +1,5 @@ -- https://github.com/folke/zen-mode.nvim -local status_ok, zenmode = pcall(require, "zen-mode") -if not status_ok then - return -end - -zenmode.setup({ +require("zen-mode").setup({ window = { backdrop = 0.98, width = 80, diff --git a/nvim/lua/kogakure/functions.lua b/nvim/lua/kogakure/functions.lua index dfefd7a..5ab1512 100644 --- a/nvim/lua/kogakure/functions.lua +++ b/nvim/lua/kogakure/functions.lua @@ -1,6 +1,10 @@ -local keymap = vim.keymap.set local opts = { noremap = true, silent = true } -local cfg = vim.fn.stdpath("config") + +-- Toggle between soft wrap and no wrap +vim.keymap.set("n", "tw", [[call ToggleWrap()]], opts) + +-- Toggle between soft wrap and no wrap +vim.keymap.set("n", "cc", [[call ToggleColorColumn()]], opts) vim.cmd([[ function! ToggleWrap() @@ -42,10 +46,3 @@ function! SpellDe() set spellfile=~/.config/nvim/spell/de.utf-8.add endfunction ]]) - --- Keymaps --- Toggle between soft wrap and no wrap -keymap("n", "tw", [[call ToggleWrap()]], opts) - --- Toggle between soft wrap and no wrap -keymap("n", "tcc", [[call ToggleColorColumn()]], opts) diff --git a/nvim/lua/kogakure/keymaps.lua b/nvim/lua/kogakure/keymaps.lua index 50062c1..39847da 100644 --- a/nvim/lua/kogakure/keymaps.lua +++ b/nvim/lua/kogakure/keymaps.lua @@ -1,162 +1,161 @@ -local keymap = vim.keymap.set local opts = { noremap = true, silent = true } --- Remap space as key -keymap("", "", "", opts) +vim.keymap.set("", "", "", opts) vim.g.mapleader = " " vim.g.maplocalleader = " " -- Quick toggle between buffers -keymap("n", "j", ":b#", opts) +vim.keymap.set("n", "j", ":b#", opts) -- Add semicolon or comma to the end of the line -keymap("n", ";;", "A;", opts) -keymap("n", ",,", "A,", opts) +vim.keymap.set("n", ";;", "A;", opts) +vim.keymap.set("n", ",,", "A,", opts) -- Maintain the cursor position when yanking a visual selection -keymap("v", "y", "myy`y", opts) +vim.keymap.set("v", "y", "myy`y", opts) -- Delete last character of line -keymap("n", "x", "$x", opts) +vim.keymap.set("n", "x", "$x", opts) -- Do not yank with x -keymap("n", "x", '"_x', opts) +vim.keymap.set("n", "x", '"_x', opts) -- Open vim config in a new buffer, reload vim config -keymap("n", "ve", "e $MYVIMRC", opts) -keymap("n", "vr", "source $MYVIMRC", opts) +vim.keymap.set("n", "ve", "e $MYVIMRC", opts) +vim.keymap.set("n", "vr", "source $MYVIMRC", opts) -- Increment/decrement -keymap("n", "+", "", opts) -keymap("n", "-", "", opts) +vim.keymap.set("n", "+", "", opts) +vim.keymap.set("n", "-", "", opts) -- Splits -keymap("n", "ss", ":splitw", opts) -keymap("n", "sv", ":vsplitw", opts) +vim.keymap.set("n", "ss", ":splitw", opts) +vim.keymap.set("n", "sv", ":vsplitw", opts) -- Select all -keymap("n", "", "ggG", opts) +vim.keymap.set("n", "", "ggG", opts) -- Delete current buffer -keymap("n", "q", ":Bdelete", opts) +vim.keymap.set("n", "q", ":Bdelete", opts) -- Delete all buffers -keymap("n", "X", ":bufdo bdelete", opts) +vim.keymap.set("n", "X", ":bufdo bdelete", opts) -- Allow gf to open non-existent files -keymap("", "gf", ":edit ", opts) +vim.keymap.set("", "gf", ":edit ", opts) -- Reselect visual selection after indenting -keymap("v", "<", "", ">gv", opts) +vim.keymap.set("v", "<", "", ">gv", opts) -- Set spell checker to `s` -- zg (good), zG (good temp), zw (wrong), zW (wrong temp) -keymap("n", "rs", ":set spell!", opts) +vim.keymap.set("n", "rs", ":set spell!", opts) -- Switch off highlighting -keymap("n", "h", ":nohlsearch", opts) +vim.keymap.set("n", "h", ":nohlsearch", opts) -- Toggle list -keymap("n", "l", ":set list!", opts) +vim.keymap.set("n", "l", ":set list!", opts) -- Indent the whole source code -keymap("n", "pf", "gg=G''", opts) +vim.keymap.set("n", "pf", "gg=G''", opts) -- Reverse the mark mapping -keymap("n", "'", "`", opts) -keymap("n", "`", "'", opts) +vim.keymap.set("n", "'", "`", opts) +vim.keymap.set("n", "`", "'", opts) -- Visuall select of just pasted content -keymap("n", "gP", "`[v`]", opts) -keymap("n", "gy", "`[v`]y", opts) +vim.keymap.set("n", "gP", "`[v`]", opts) +vim.keymap.set("n", "gy", "`[v`]y", opts) -- When text is wrapped, move by terminal rows, not lines, unless a count is provided -keymap("n", " j", "(v:count == 0 ? 'gj' : 'j')", opts) -keymap("n", " k", "(v:count == 0 ? 'gk' : 'k')", opts) +vim.keymap.set("n", " j", "(v:count == 0 ? 'gj' : 'j')", opts) +vim.keymap.set("n", " k", "(v:count == 0 ? 'gk' : 'k')", opts) -- Open a quickfix window for the last search -keymap("n", "?", ":execute 'vimgrep /'.@/.'/g %':copen", opts) +vim.keymap.set("n", "?", ":execute 'vimgrep /'.@/.'/g %':copen", opts) -- Faster linewise scrolling -keymap("n", "", "3", opts) -keymap("n", "", "3", opts) +vim.keymap.set("n", "", "3", opts) +vim.keymap.set("n", "", "3", opts) -- Keep the window centered -keymap("n", "G", "Gzzzv", opts) -keymap("n", "n", "nzzzv", opts) -keymap("n", "N", "Nzzzv", opts) -keymap("n", "", "zz", opts) -keymap("n", "", "zz", opts) +vim.keymap.set("n", "G", "Gzzzv", opts) +vim.keymap.set("n", "n", "nzzzv", opts) +vim.keymap.set("n", "N", "Nzzzv", opts) +vim.keymap.set("n", "", "zz", opts) +vim.keymap.set("n", "", "zz", opts) -- Copy to the end of the line -keymap("n", "Y", "yg$", opts) +vim.keymap.set("n", "Y", "yg$", opts) -- Close all buffers -keymap("n", "XX", ":qa", opts) +vim.keymap.set("n", "XX", ":qa", opts) -- Add lines in NORMAL Mode -keymap("n", "gN", "ok", opts) -keymap("n", "gNN", "Oj", opts) +vim.keymap.set("n", "gN", "ok", opts) +vim.keymap.set("n", "gNN", "Oj", opts) -- Change to the folder of the current file -keymap("n", "cf", ":cd %:p:h:pwd", opts) +vim.keymap.set("n", "cf", ":cd %:p:h:pwd", opts) -- Reformat a line into a block -keymap("n", "rq", "gqip", opts) +vim.keymap.set("n", "rq", "gqip", opts) -- Reformat a block into a line -keymap("n", "rqq", "vipJ", opts) +vim.keymap.set("n", "rqq", "vipJ", opts) -- Easier split navigation -keymap("n", "", "", opts) -keymap("n", "", "", opts) -keymap("n", "", "", opts) -keymap("n", "", "", opts) +vim.keymap.set("n", "", "", opts) +vim.keymap.set("n", "", "", opts) +vim.keymap.set("n", "", "", opts) +vim.keymap.set("n", "", "", opts) -- Resize with arrows -keymap("n", "", ":resize +2", opts) -keymap("n", "", ":resize -2", opts) -keymap("n", "", ":vertical resize +2", opts) -keymap("n", "", ":vertical resize -2", opts) +vim.keymap.set("n", "", ":resize +2", opts) +vim.keymap.set("n", "", ":resize -2", opts) +vim.keymap.set("n", "", ":vertical resize +2", opts) +vim.keymap.set("n", "", ":vertical resize -2", opts) -- Stay in indent mode -keymap("v", "<", "", ">gv", opts) +vim.keymap.set("v", "<", "", ">gv", opts) -- Move text up and down -keymap("v", "", ":m .+1==", opts) -keymap("v", "", ":m .-2==", opts) +vim.keymap.set("v", "", ":m .+1==", opts) +vim.keymap.set("v", "", ":m .-2==", opts) -- Navigate buffers ---[[ keymap("n", "", ":bnext", opts) ]] ---[[ keymap("n", "", ":bprevious", opts) ]] +--[[ vim.keymap.set("n", "", ":bnext", opts) ]] +--[[ vim.keymap.set("n", "", ":bprevious", opts) ]] -- Remap Jump to Tag -keymap("n", "ΓΌ", "", opts) -keymap("n", "Ü", "", opts) +vim.keymap.set("n", "ΓΌ", "", opts) +vim.keymap.set("n", "Ü", "", opts) -- Open for Markdown in iA Writer -keymap("n", "ia", ":silent !open -a iA\\ Writer.app '%:p'", opts) +vim.keymap.set("n", "ia", ":silent !open -a iA\\ Writer.app '%:p'", opts) -- Custom Text-Objects -keymap("o", "il", ":normal! $v^", opts) -keymap("x", "il", ":normal! $v^", opts) -keymap("o", "al", ":normal! $v0", opts) -keymap("x", "al", ":normal! $v0", opts) +vim.keymap.set("o", "il", ":normal! $v^", opts) +vim.keymap.set("x", "il", ":normal! $v^", opts) +vim.keymap.set("o", "al", ":normal! $v0", opts) +vim.keymap.set("x", "al", ":normal! $v0", opts) -- LSP formatting -keymap("n", "o", "lua vim.lsp.buf.format()", opts) +vim.keymap.set("n", "o", "lua vim.lsp.buf.format()", opts) -- Manual Prettier -keymap("n", "P", "Prettier", opts) +vim.keymap.set("n", "P", "Prettier", opts) -- Get the filename and path of current file -keymap("n", "kn", ":let @+=@%", opts) +vim.keymap.set("n", "kn", ":let @+=@%", opts) -- Remove console.log statements -keymap("n", "kc", ":g/console.log/d", opts) +vim.keymap.set("n", "kc", ":g/console.log/d", opts) -- Convert Markdown to HTML and copy to Clipboard -keymap("v", "kp", ":'<,'> w !pandoc --no-highlight --wrap=none | pbcopy ", opts) +vim.keymap.set("v", "kp", ":'<,'> w !pandoc --no-highlight --wrap=none | pbcopy ", opts) diff --git a/nvim/lua/kogakure/plugins.lua b/nvim/lua/kogakure/plugins.lua index 36a603e..3a206ca 100644 --- a/nvim/lua/kogakure/plugins.lua +++ b/nvim/lua/kogakure/plugins.lua @@ -128,7 +128,6 @@ return packer.startup(function(use) use("MattesGroeger/vim-bookmarks") -- Bookmarks use("folke/which-key.nvim") -- Display possible keybindings use("mrjones2014/legendary.nvim") -- Legend for keymaps, commands, and autocommands - use("karb94/neoscroll.nvim") -- Smooth scrolling use("APZelos/blamer.nvim") -- Git Blame use("tpope/vim-fugitive") -- Git plugin use("elijahmanor/export-to-vscode.nvim") -- Export active Buffers to Visual Studio Code @@ -137,7 +136,7 @@ return packer.startup(function(use) use("pwntester/octo.nvim") -- GitHub in Neovim use("nvim-pack/nvim-spectre") -- Search and replace use("stevearc/dressing.nvim") -- Improve the default vim.ui interfaces - use("folke/zen-mode.nvim") -- Zen Mode (2) + use("folke/zen-mode.nvim") -- Zen Mode use("tpope/vim-eunuch") -- UNIX Shell commands use("folke/twilight.nvim") -- Dim inactive code use("ray-x/guihua.lua") -- Lua GUI lib