chore(nvim): simplify imports and clean up plugin files

This commit is contained in:
Stefan Imhoff
2022-12-17 17:48:17 +01:00
parent 68a3d0deab
commit a7e00b506d
51 changed files with 245 additions and 487 deletions

View File

@@ -122,5 +122,6 @@ function ReloadConfig(files)
hs.reload() hs.reload()
end end
end end
hs.pathwatcher.new(os.getenv("HOME") .. "/.hammerspoon/", ReloadConfig):start() hs.pathwatcher.new(os.getenv("HOME") .. "/.hammerspoon/", ReloadConfig):start()
hs.alert.show("Hammerspoon") hs.alert.show("Hammerspoon")

View File

@@ -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{}")

View File

@@ -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{}

View File

@@ -1,10 +1,7 @@
-- https://github.com/goolord/alpha-nvim -- https://github.com/goolord/alpha-nvim
local status_ok, alpha = pcall(require, "alpha") local alpha = require("alpha")
if not status_ok then
return
end
local dashboard = require("alpha.themes.dashboard") local dashboard = require("alpha.themes.dashboard")
dashboard.section.header.val = { dashboard.section.header.val = {
[[🟨🟨🟨🟨🟨🟨🟨🟨]], [[🟨🟨🟨🟨🟨🟨🟨🟨]],
[[🟨🟨🟨🟨🟨🟨🟨🟨]], [[🟨🟨🟨🟨🟨🟨🟨🟨]],
@@ -30,7 +27,6 @@ dashboard.section.buttons.val = {
dashboard.section.footer.opts.hl = "Type" dashboard.section.footer.opts.hl = "Type"
dashboard.section.header.opts.hl = "Include" dashboard.section.header.opts.hl = "Include"
dashboard.section.buttons.opts.hl = "Keyword" dashboard.section.buttons.opts.hl = "Keyword"
dashboard.opts.opts.noautocmd = true dashboard.opts.opts.noautocmd = true
alpha.setup(dashboard.opts) alpha.setup(dashboard.opts)

View File

@@ -1,3 +1,2 @@
-- https://github.com/wuelnerdotexe/vim-astro -- https://github.com/wuelnerdotexe/vim-astro
vim.g.astro_typescript = "enable" vim.g.astro_typescript = "enable"

View File

@@ -1,10 +1,8 @@
-- https://github.com/windwp/nvim-autopairs -- https://github.com/windwp/nvim-autopairs
local status_ok, autopairs = pcall(require, "nvim-autopairs") local cmp = require("cmp")
if not status_ok then local cmp_autopairs = require("nvim-autopairs.completion.cmp")
return
end
autopairs.setup({ require("nvim-autopairs").setup({
check_ts = true, check_ts = true,
ts_config = { ts_config = {
lua = { "string", "source" }, 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 = "" } })) cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({ map_char = { tex = "" } }))

View File

@@ -1,9 +1,4 @@
-- https://github.com/windwp/nvim-ts-autotag -- https://github.com/windwp/nvim-ts-autotag
local status_ok, autotag = pcall(require, "nvim-ts-autotag") require("nvim-ts-autotag").setup({
if not status_ok then
return
end
autotag.setup({
disable_filetype = { "TelescopePrompt", "vim" }, disable_filetype = { "TelescopePrompt", "vim" },
}) })

View File

@@ -1,10 +1,8 @@
-- https://github.com/APZelos/blamer.nvim -- https://github.com/APZelos/blamer.nvim
local keymap = vim.keymap.set
local opts = { noremap = true, silent = true } local opts = { noremap = true, silent = true }
vim.g.blamer_enabled = 0 vim.g.blamer_enabled = 0
vim.g.blamer_relative_time = 1 vim.g.blamer_relative_time = 1
vim.g.blamer_delay = 200 vim.g.blamer_delay = 200
-- Keymaps vim.keymap.set("n", "<leader>tb", [[<Cmd>BlamerToggle<CR>]], opts)
keymap("n", "<leader>tb", [[<Cmd>BlamerToggle<CR>]], opts)

View File

@@ -1,10 +1,5 @@
-- https://github.com/akinsho/bufferline.nvim -- https://github.com/akinsho/bufferline.nvim
local status_ok, bufferline = pcall(require, "bufferline") require("bufferline").setup({
if not status_ok then
return
end
bufferline.setup({
highlights = { highlights = {
fill = { fill = {
bg = "#282828", bg = "#282828",

View File

@@ -1,9 +1,6 @@
-- https://github.com/catppuccin/catppuccin -- 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() require("catppuccin").setup()

View File

@@ -1,13 +1,6 @@
-- https://github.com/hrsh7th/nvim-cmp -- https://github.com/hrsh7th/nvim-cmp
local cmp_status_ok, cmp = pcall(require, "cmp") local cmp = require("cmp")
if not cmp_status_ok then local luasnip = require("luasnip")
return
end
local snip_status_ok, luasnip = pcall(require, "luasnip")
if not snip_status_ok then
return
end
require("luasnip/loaders/from_vscode").lazy_load() 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") return col == 0 or vim.fn.getline("."):sub(col, col):match("%s")
end end
--   פּ ﯟ   some other good icons
local kind_icons = { local kind_icons = {
Text = "", Text = "",
Method = "m", Method = "m",
@@ -45,7 +37,6 @@ local kind_icons = {
TypeParameter = "", TypeParameter = "",
Octoface = "", Octoface = "",
} }
-- find more here: https://www.nerdfonts.com/cheat-sheet
cmp.setup({ cmp.setup({
snippet = { snippet = {

View File

@@ -1,8 +1,5 @@
-- https://github.com/gorbit99/codewindow.nvim -- https://github.com/gorbit99/codewindow.nvim
local status, codewindow = pcall(require, "codewindow") local codewindow = require("codewindow")
if not status then
return
end
codewindow.setup() codewindow.setup()

View File

@@ -1,10 +1,5 @@
-- https://github.com/norcalli/nvim-colorizer.lua -- https://github.com/norcalli/nvim-colorizer.lua
local status, colorizer = pcall(require, "colorizer") require("colorizer").setup({
if not status then
return
end
colorizer.setup({
"css", "css",
"html", "html",
"javascript", "javascript",
@@ -12,13 +7,13 @@ colorizer.setup({
"typescript", "typescript",
"typescriptreact", "typescriptreact",
}, { }, {
RGB = true, -- #RGB hex codes RGB = true,
RRGGBB = true, -- #RRGGBB hex codes RRGGBB = true,
names = true, -- "Name" codes like Blue names = true,
RRGGBBAA = true, -- #RRGGBBAA hex codes RRGGBBAA = true,
rgb_fn = true, -- CSS rgb() and rgba() functions rgb_fn = true,
hsl_fn = true, -- CSS hsl() and hsla() functions hsl_fn = true,
css = true, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB css = true,
css_fn = true, -- Enable all CSS *functions*: rgb_fn, hsl_fn css_fn = true,
mode = "background", -- Set the display mode.) mode = "background",
}) })

View File

@@ -1,10 +1,5 @@
-- https://github.com/numToStr/comment.nvim -- https://github.com/numToStr/comment.nvim
local status_ok, comment = pcall(require, "Comment") require("Comment").setup({
if not status_ok then
return
end
comment.setup({
pre_hook = function(ctx) pre_hook = function(ctx)
local U = require("Comment.utils") local U = require("Comment.utils")

View File

@@ -1,10 +1,5 @@
-- https://github.com/nvim-treesitter/nvim-treesitter-context -- https://github.com/nvim-treesitter/nvim-treesitter-context
local status_ok, context = pcall(require, "treesitter-context") require("treesitter-context").setup({
if not status_ok then
return
end
context.setup({
patterns = { patterns = {
default = { default = {
"class", "class",

View File

@@ -1,10 +1,5 @@
-- https://github.com/yamatsum/nvim-cursorline -- https://github.com/yamatsum/nvim-cursorline
local status, cursorline = pcall(require, "nvim-cursorline") require("nvim-cursorline").setup({
if not status then
return
end
cursorline.setup({
cursorline = { cursorline = {
enable = true, enable = true,
timeout = 1000, timeout = 1000,

View File

@@ -1,10 +1,5 @@
-- https://github.com/karb94/neoscroll.nvim -- https://github.com/monaqa/dial.nvim
local status, augend = pcall(require, "dial.augend") local augend = require("dial.augend")
if not status then
return
end
local keymap = vim.keymap.set
local opts = { noremap = true, silent = true } local opts = { noremap = true, silent = true }
require("dial.config").augends:register_group({ require("dial.config").augends:register_group({
@@ -19,10 +14,9 @@ require("dial.config").augends:register_group({
}, },
}) })
-- Keymaps vim.keymap.set("n", "<C-a>", require("dial.map").inc_normal(), opts)
keymap("n", "<C-a>", require("dial.map").inc_normal(), opts) vim.keymap.set("n", "<C-x>", require("dial.map").dec_normal(), opts)
keymap("n", "<C-x>", require("dial.map").dec_normal(), opts) vim.keymap.set("v", "<C-a>", require("dial.map").inc_visual(), opts)
keymap("v", "<C-a>", require("dial.map").inc_visual(), opts) vim.keymap.set("v", "<C-x>", require("dial.map").dec_visual(), opts)
keymap("v", "<C-x>", require("dial.map").dec_visual(), opts) vim.keymap.set("v", "g<C-a>", require("dial.map").inc_gvisual(), opts)
keymap("v", "g<C-a>", require("dial.map").inc_gvisual(), opts) vim.keymap.set("v", "g<C-x>", require("dial.map").dec_gvisual(), opts)
keymap("v", "g<C-x>", require("dial.map").dec_gvisual(), opts)

View File

@@ -1,7 +1,2 @@
-- https://github.com/stevearc/dressing.nvim -- https://github.com/stevearc/dressing.nvim
local status, dressing = pcall(require, "dressing") require("dressing").setup()
if not status then
return
end
dressing.setup()

View File

@@ -1,6 +1,4 @@
--- https://github.com/elijahmanor/export-to-vscode.nvim --- https://github.com/elijahmanor/export-to-vscode.nvim
local keymap = vim.keymap.set
local opts = { noremap = true, silent = true } local opts = { noremap = true, silent = true }
-- Keymaps vim.keymap.set("n", "<leader>code", [[<Cmd>lua require("export-to-vscode").launch()<CR>]], opts)
keymap("n", "<leader>code", [[<Cmd>lua require("export-to-vscode").launch()<CR>]], opts)

View File

@@ -1,44 +1,35 @@
-- https://github.com/ibhagwan/fzf-lua -- 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 } local opts = { noremap = true, silent = true }
fzf_lua.setup({ require("fzf-lua").setup({
lsp = { lsp = {
async_or_timeout = 3000, -- make lsp requests synchronous so they work with null-ls async_or_timeout = 3000, -- make lsp requests synchronous so they work with null-ls
}, },
}) })
-- Keymaps vim.keymap.set("n", "<leader>zbl", [[<Cmd>FzfLua blines<CR>]], opts)
-- keymap("n", "<C-p>", [[<Cmd>:FzfLua files<CR>]], opts) vim.keymap.set("n", "<leader>zf", [[<Cmd>FzfLua Files<CR>]], opts)
-- keymap("n", "<leader>b", [[<Cmd>:FzfLua buffers<CR>]], opts) vim.keymap.set("n", "<leader>zg", [[<Cmd>FzfLua Grep<CR>]], opts)
keymap("n", "<leader>zbl", [[<Cmd>FzfLua blines<CR>]], opts) vim.keymap.set("n", "<leader>zgb", [[<Cmd>FzfLua git_branches<CR>]], opts)
keymap("n", "<leader>zf", [[<Cmd>FzfLua files<CR>]], opts) vim.keymap.set("n", "<leader>zgc", [[<Cmd>FzfLua git_commits<CR>]], opts)
keymap("n", "<leader>zg", [[<Cmd>FzfLua grep<CR>]], opts) vim.keymap.set("n", "<leader>zgl", [[<Cmd>FzfLua grep_last<CR>]], opts)
keymap("n", "<leader>zgb", [[<Cmd>FzfLua git_branches<CR>]], opts) vim.keymap.set("n", "<leader>zgp", [[<Cmd>FzfLua grep_project<CR>]], opts)
keymap("n", "<leader>zgc", [[<Cmd>FzfLua git_commits<CR>]], opts) vim.keymap.set("n", "<leader>zgs", [[<Cmd>FzfLua git_status<CR>]], opts)
keymap("n", "<leader>zgl", [[<Cmd>FzfLua grep_last<CR>]], opts) vim.keymap.set("n", "<leader>zgst", [[<Cmd>FzfLua git_stash<CR>]], opts)
keymap("n", "<leader>zgp", [[<Cmd>FzfLua grep_project<CR>]], opts) vim.keymap.set("n", "<leader>zgv", [[<Cmd>FzfLua grep_visual<CR>]], opts)
keymap("n", "<leader>zgs", [[<Cmd>FzfLua git_status<CR>]], opts) vim.keymap.set("n", "<leader>zgw", [[<Cmd>FzfLua grep_cword<CR>]], opts)
keymap("n", "<leader>zgst", [[<Cmd>FzfLua git_stash<CR>]], opts) vim.keymap.set("n", "<leader>zh", [[<Cmd>FzfLua oldfiles<CR>]], opts)
keymap("n", "<leader>zgv", [[<Cmd>FzfLua grep_visual<CR>]], opts) vim.keymap.set("n", "<leader>zl", [[<Cmd>FzfLua lines<CR>]], opts)
keymap("n", "<leader>zgw", [[<Cmd>FzfLua grep_cword<CR>]], opts) vim.keymap.set("n", "<leader>zlca", [[<Cmd>FzfLua code_actions<CR>]], opts)
keymap("n", "<leader>zh", [[<Cmd>FzfLua oldfiles<CR>]], opts) vim.keymap.set("n", "<leader>zld", [[<Cmd>FzfLua lsp_definitions<CR>]], opts)
keymap("n", "<leader>zl", [[<Cmd>FzfLua lines<CR>]], opts) vim.keymap.set("n", "<leader>zlds", [[<Cmd>FzfLua lsp_document_symbols<CR>]], opts)
keymap("n", "<leader>zlca", [[<Cmd>FzfLua code_actions<CR>]], opts) vim.keymap.set("n", "<leader>zlg", [[<Cmd>FzfLua live_grep<CR>]], opts)
keymap("n", "<leader>zld", [[<Cmd>FzfLua lsp_definitions<CR>]], opts) vim.keymap.set("n", "<leader>zlgr", [[<Cmd>FzfLua live_grep_resume<CR>]], opts)
keymap("n", "<leader>zlds", [[<Cmd>FzfLua lsp_document_symbols<CR>]], opts) vim.keymap.set("n", "<leader>zlr", [[<Cmd>FzfLua lsp_references<CR>]], opts)
keymap("n", "<leader>zlg", [[<Cmd>FzfLua live_grep<CR>]], opts) vim.keymap.set("n", "<leader>zltd", [[<Cmd>FzfLua lsp_typedef<CR>]], opts)
keymap("n", "<leader>zlgr", [[<Cmd>FzfLua live_grep_resume<CR>]], opts) vim.keymap.set("n", "<leader>zlws", [[<Cmd>FzfLua lsp_live_workspace_symbols<CR>]], opts)
keymap("n", "<leader>zlr", [[<Cmd>FzfLua lsp_references<CR>]], opts) vim.keymap.set("n", "<leader>zm", [[<Cmd>FzfLua marks<CR>]], opts)
keymap("n", "<leader>zltd", [[<Cmd>FzfLua lsp_typedef<CR>]], opts) vim.keymap.set("n", "<leader>zqfq", [[<Cmd>FzfLua quickfix<CR>]], opts)
keymap("n", "<leader>zlws", [[<Cmd>FzfLua lsp_live_workspace_symbols<CR>]], opts) vim.keymap.set("n", "<leader>zr", [[<Cmd>FzfLua resume<CR>]], opts)
keymap("n", "<leader>zm", [[<Cmd>FzfLua marks<CR>]], opts) vim.keymap.set("n", "<leader>zss", [[<Cmd>FzfLua spell_suggest<CR>]], opts)
keymap("n", "<leader>zqfq", [[<Cmd>FzfLua quickfix<CR>]], opts) vim.keymap.set("n", "<leader>ztg", [[<Cmd>FzfLua tabs<CR>]], opts)
keymap("n", "<leader>zr", [[<Cmd>FzfLua resume<CR>]], opts)
keymap("n", "<leader>zss", [[<Cmd>FzfLua spell_suggest<CR>]], opts)
keymap("n", "<leader>ztg", [[<Cmd>FzfLua tabs<CR>]], opts)

View File

@@ -1,9 +1,4 @@
-- https://github.com/ThePrimeagen/git-worktree.nvim -- 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" vim.g.git_worktree_log_level = "error"
worktree.setup() require("git-worktree").setup()

View File

@@ -1,10 +1,5 @@
-- https://github.com/lewis6991/gitsigns.nvim -- https://github.com/lewis6991/gitsigns.nvim
local status_ok, gitsigns = pcall(require, "gitsigns") require("gitsigns").setup({
if not status_ok then
return
end
gitsigns.setup({
signs = { signs = {
add = { hl = "GitSignsAdd", text = "", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" }, add = { hl = "GitSignsAdd", text = "", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" },
change = { hl = "GitSignsChange", text = "", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" }, change = { hl = "GitSignsChange", text = "", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" },

View File

@@ -1,16 +1,9 @@
-- https://github.com/DNLHC/glance.nvim -- 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 } local opts = { noremap = true, silent = true }
glance.setup() vim.keymap.set("n", "gld", "<CMD>Glance definitions<CR>", opts)
vim.keymap.set("n", "gli", "<CMD>Glance implementations<CR>", opts)
vim.keymap.set("n", "glr", "<CMD>Glance references<CR>", opts)
vim.keymap.set("n", "glt", "<CMD>Glance type_definitions<CR>", opts)
-- Keymaps require("glance").setup()
keymap("n", "gld", "<CMD>Glance definitions<CR>", opts)
keymap("n", "gli", "<CMD>Glance implementations<CR>", opts)
keymap("n", "glr", "<CMD>Glance references<CR>", opts)
keymap("n", "glt", "<CMD>Glance type_definitions<CR>", opts)

View File

@@ -1,18 +1,12 @@
-- https://github.com/ThePrimeagen/harpoon -- https://github.com/ThePrimeagen/harpoon
local status, harpoon = pcall(require, "harpoon") local harpoon = require("harpoon")
if not status then
return
end
local keymap = vim.keymap.set
local opts = { noremap = true, silent = true } local opts = { noremap = true, silent = true }
harpoon.setup() vim.keymap.set("n", "<leader>a", [[<Cmd>lua require("harpoon.mark").add_file()<CR>]], opts)
vim.keymap.set("n", "<leader>,", [[<Cmd>lua require("harpoon.ui").toggle_quick_menu()<CR>]], opts)
vim.keymap.set("n", "<leader>1", [[<Cmd>lua require("harpoon.ui").nav_file(1)<CR>]], opts)
vim.keymap.set("n", "<leader>2", [[<Cmd>lua require("harpoon.ui").nav_file(2)<CR>]], opts)
vim.keymap.set("n", "<leader>3", [[<Cmd>lua require("harpoon.ui").nav_file(3)<CR>]], opts)
vim.keymap.set("n", "<leader>4", [[<Cmd>lua require("harpoon.ui").nav_file(4)<CR>]], opts)
-- Keymaps harpoon.setup()
keymap("n", "<leader>a", [[<Cmd>lua require("harpoon.mark").add_file()<CR>]], opts)
keymap("n", "<leader>,", [[<Cmd>lua require("harpoon.ui").toggle_quick_menu()<CR>]], opts)
keymap("n", "<leader>1", [[<Cmd>lua require("harpoon.ui").nav_file(1)<CR>]], opts)
keymap("n", "<leader>2", [[<Cmd>lua require("harpoon.ui").nav_file(2)<CR>]], opts)
keymap("n", "<leader>3", [[<Cmd>lua require("harpoon.ui").nav_file(3)<CR>]], opts)
keymap("n", "<leader>4", [[<Cmd>lua require("harpoon.ui").nav_file(4)<CR>]], opts)

View File

@@ -1,7 +1,4 @@
-- https://github.com/lewis6991/impatient.nvim -- https://github.com/lewis6991/impatient.nvim
local status_ok, impatient = pcall(require, "impatient") local impatient = require("impatient")
if not status_ok then
return
end
impatient.enable_profile() impatient.enable_profile()

View File

@@ -1,14 +1,10 @@
-- https://github.com/lukas-reineke/indent-blankline.nvim -- https://github.com/lukas-reineke/indent-blankline.nvim
local status_ok, indent_blankline = pcall(require, "indent_blankline") local indent_blankline = require("indent_blankline")
if not status_ok then
return
end
vim.opt.termguicolors = true vim.opt.termguicolors = true
vim.cmd([[
highlight IndentBlanklineIndent1 guibg=#1f1f1f gui=nocombine vim.api.nvim_set_hl(0, "IndentBlanklineIndent1", { bg = "#1f1f1f", nocombine = true })
highlight IndentBlanklineIndent2 guibg=#1a1a1a gui=nocombine vim.api.nvim_set_hl(0, "IndentBlanklineIndent2", { bg = "#1a1a1a", nocombine = true })
]])
indent_blankline.setup({ indent_blankline.setup({
char = "", char = "",

View File

@@ -1,13 +1,7 @@
-- https://github.com/mrjones2014/legendary.nvim -- https://github.com/mrjones2014/legendary.nvim
local status, legendary = pcall(require, "legendary") local legendary = require("legendary")
if not status then
return
end
local keymap = vim.keymap.set
local opts = { noremap = true, silent = true } local opts = { noremap = true, silent = true }
legendary.setup({ which_key = { auto_register = true } }) vim.keymap.set("n", "LL", "<CMD>Legendary<CR>", opts)
-- Keymaps legendary.setup({ which_key = { auto_register = true } })
keymap("n", "LL", "<CMD>Legendary<CR>", opts)

View File

@@ -1,13 +1,7 @@
-- https://github.com/nvim-lualine/lualine.nvim -- https://github.com/nvim-lualine/lualine.nvim
local status, lualine = pcall(require, "lualine") require("lualine").setup({
if not status then
return
end
lualine.setup({
options = { options = {
icons_enabled = true, icons_enabled = true,
--[[ theme = "onedark", ]]
theme = "tokyonight", theme = "tokyonight",
component_separators = { left = "", right = "" }, component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" }, section_separators = { left = "", right = "" },

View File

@@ -1,7 +0,0 @@
-- https://github.com/karb94/neoscroll.nvim
local status, neoscroll = pcall(require, "neoscroll")
if not status then
return
end
--[[ neoscroll.setup() ]]

View File

@@ -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

View File

@@ -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

View File

@@ -1,10 +1,5 @@
-- https://github.com/kyazdani42/nvim-tree.lua -- https://github.com/kyazdani42/nvim-tree.lua
local status_ok, nvim_tree = pcall(require, "nvim-tree") require("nvim-tree").setup({
if not status_ok then
return
end
nvim_tree.setup({
update_focused_file = { update_focused_file = {
enable = true, enable = true,
update_root = true, update_root = true,

View File

@@ -1,7 +1,2 @@
-- https://github.com/pwntester/octo.nvim -- https://github.com/pwntester/octo.nvim
local status_ok, octo = pcall(require, "octo") require("octo").setup()
if not status_ok then
return
end
octo.setup()

View File

@@ -1,10 +1,9 @@
-- https://github.com/ahmedkhalf/project.nvim -- https://github.com/ahmedkhalf/project.nvim
local status_ok, project = pcall(require, "project_nvim") local opts = { noremap = true, silent = true }
if not status_ok then
return
end
project.setup({ vim.keymap.set("n", "<leader>pm", [[<Cmd>:Telescope projects<CR>]], opts)
require("project_nvim").setup({
active = true, active = true,
on_config_done = nil, on_config_done = nil,
manual_mode = false, manual_mode = false,
@@ -23,8 +22,3 @@ project.setup({
ignore_lsp = {}, ignore_lsp = {},
datapath = vim.fn.stdpath("data"), datapath = vim.fn.stdpath("data"),
}) })
local keymap = vim.keymap.set
local opts = { noremap = true, silent = true }
keymap("n", "<leader>pm", [[<Cmd>:Telescope projects<CR>]], opts)

View File

@@ -1,10 +1,5 @@
-- https://github.com/ray-x/sad.nvim -- https://github.com/ray-x/sad.nvim
local status_ok, sad = pcall(require, "sad") require("sad").setup({
if not status_ok then
return
end
sad.setup({
diff = "delta", -- you can use `diff`, `diff-so-fancy` diff = "delta", -- you can use `diff`, `diff-so-fancy`
ls_file = "fd", -- also git ls_file ls_file = "fd", -- also git ls_file
exact = false, -- exact match exact = false, -- exact match

View File

@@ -1,7 +1,2 @@
-- https://github.com/nvim-pack/nvim-spectre -- https://github.com/nvim-pack/nvim-spectre
local status_ok, spectre = pcall(require, "spectre") require("spectre").setup()
if not status_ok then
return
end
spectre.setup()

View File

@@ -1,7 +1,2 @@
-- https://github.com/kylechui/nvim-surround -- https://github.com/kylechui/nvim-surround
local status_ok, surround = pcall(require, "nvim-surround") require("nvim-surround").setup()
if not status_ok then
return
end
surround.setup()

View File

@@ -1,9 +1,4 @@
-- https://github.com/simrat39/symbols-outline.nvim -- https://github.com/simrat39/symbols-outline.nvim
local status_ok, outline = pcall(require, "symbols-outline") require("symbols-outline").setup({
if not status_ok then
return
end
outline.setup({
width = 25, width = 25,
}) })

View File

@@ -6,7 +6,6 @@ AddTabularPattern! ruby_hash /^[^=>]*\zs=>/
AddTabularPattern! commas /,\s*\zs\s/l0 AddTabularPattern! commas /,\s*\zs\s/l0
AddTabularPattern! colons /^[^:]*:\s*\zs\s/l0 AddTabularPattern! colons /^[^:]*:\s*\zs\s/l0
" Mappings
inoremap <silent> <Bar> <Bar><Esc>:call <SID>align()<CR>a inoremap <silent> <Bar> <Bar><Esc>:call <SID>align()<CR>a
" Automatic Tabular.vim with the (|) " Automatic Tabular.vim with the (|)

View File

@@ -1,15 +1,33 @@
-- https://github.com/nvim-telescope/telescope.nvim/ -- https://github.com/nvim-telescope/telescope.nvim/
local status_ok, telescope = pcall(require, "telescope") local telescope = require("telescope")
if not status_ok then local actions = require("telescope.actions")
return
end
local keymap = vim.keymap.set
local opts = { noremap = true, silent = true } local opts = { noremap = true, silent = true }
local actions = require("telescope.actions") vim.keymap.set("n", "<C-p>", [[<Cmd>Telescope find_files<CR>]], opts)
vim.keymap.set("n", "<leader>C", [[<Cmd>Cheatsheet<CR>]], opts)
vim.keymap.set("n", "<leader>F", [[<Cmd>Telescope live_grep<CR>]], opts)
vim.keymap.set("n", "<leader>H", [[<Cmd>Telescope headings<CR>]], opts)
vim.keymap.set("n", "<leader>S", [[<Cmd>Telescope spell_suggest<CR>]], opts)
vim.keymap.set("n", "<leader>b", [[<Cmd>Telescope buffers<CR>]], opts)
vim.keymap.set("n", "<leader>bm", [[<Cmd>Telescope bookmarks<CR>]], opts)
vim.keymap.set("n", "<leader>f", [[<Cmd>Telescope current_buffer_fuzzy_find<CR>]], opts)
vim.keymap.set("n", "<leader>fa", [[<Cmd>Telescope find_files hidden=true<CR>]], opts)
vim.keymap.set("n", "<leader>fb", [[<Cmd>Telescope file_browser<CR>]], opts)
vim.keymap.set("n", "<leader>fd", [[<Cmd>Telescope dir live_grep<CR>]], opts)
vim.keymap.set("n", "<leader>ff", [[<Cmd>Telescope dir find_files<CR>]], opts)
vim.keymap.set("n", "<leader>gb", [[<Cmd>Telescope git_branches<CR>]], opts)
vim.keymap.set("n", "<leader>gs", [[<Cmd>Telescope git_status<CR>]], opts)
vim.keymap.set("n", "<leader>gwc", [[<Cmd>Telescope git_worktree create_git_worktree<CR>]], opts)
vim.keymap.set("n", "<leader>gww", [[<Cmd>Telescope git_worktree git_worktrees<CR>]], opts)
vim.keymap.set("n", "<leader>ht", [[<Cmd>Telescope help_tags<CR>]], opts)
vim.keymap.set("n", "<leader>km", [[<Cmd>Telescope keymaps<CR>]], opts)
vim.keymap.set("n", "<leader>m", [[<Cmd>Telescope marks<CR>]], opts)
vim.keymap.set("n", "<leader>mru", [[<Cmd>Telescope frecency<CR>]], opts)
vim.keymap.set("n", "<leader>nm", [[<Cmd>Telescope node_modules list<CR>]], opts)
vim.keymap.set("n", "<leader>r", [[<Cmd>Telescope resume<CR>]], opts)
vim.keymap.set("n", "<leader>tg", [[<Cmd>Telescope tags<CR>]], opts)
vim.keymap.set("n", "<leader>ty", [[<Cmd>Telescope symbols<CR>]], opts)
-- Extensions
telescope.load_extension("bookmarks") telescope.load_extension("bookmarks")
telescope.load_extension("node_modules") telescope.load_extension("node_modules")
telescope.load_extension("file_browser") telescope.load_extension("file_browser")
@@ -23,33 +41,6 @@ telescope.load_extension("gh")
telescope.load_extension("git_worktree") telescope.load_extension("git_worktree")
telescope.load_extension("dir") telescope.load_extension("dir")
-- Keymaps
keymap("n", "<C-p>", [[<Cmd>Telescope find_files<CR>]], opts)
keymap("n", "<leader>C", [[<Cmd>Cheatsheet<CR>]], opts)
keymap("n", "<leader>F", [[<Cmd>Telescope live_grep<CR>]], opts)
keymap("n", "<leader>H", [[<Cmd>Telescope headings<CR>]], opts)
keymap("n", "<leader>S", [[<Cmd>Telescope spell_suggest<CR>]], opts)
keymap("n", "<leader>b", [[<Cmd>Telescope buffers<CR>]], opts)
keymap("n", "<leader>bm", [[<Cmd>Telescope bookmarks<CR>]], opts)
keymap("n", "<leader>f", [[<Cmd>Telescope current_buffer_fuzzy_find<CR>]], opts)
keymap("n", "<leader>fa", [[<Cmd>Telescope find_files hidden=true<CR>]], opts)
keymap("n", "<leader>fb", [[<Cmd>Telescope file_browser<CR>]], opts)
keymap("n", "<leader>fd", [[<Cmd>Telescope dir live_grep<CR>]], opts)
keymap("n", "<leader>ff", [[<Cmd>Telescope dir find_files<CR>]], opts)
keymap("n", "<leader>gb", [[<Cmd>Telescope git_branches<CR>]], opts)
keymap("n", "<leader>gs", [[<Cmd>Telescope git_status<CR>]], opts)
keymap("n", "<leader>gwc", [[<Cmd>Telescope git_worktree create_git_worktree<CR>]], opts)
keymap("n", "<leader>gww", [[<Cmd>Telescope git_worktree git_worktrees<CR>]], opts)
keymap("n", "<leader>ht", [[<Cmd>Telescope help_tags<CR>]], opts)
keymap("n", "<leader>km", [[<Cmd>Telescope keymaps<CR>]], opts)
keymap("n", "<leader>m", [[<Cmd>Telescope marks<CR>]], opts)
keymap("n", "<leader>mru", [[<Cmd>Telescope frecency<CR>]], opts)
keymap("n", "<leader>nm", [[<Cmd>Telescope node_modules list<CR>]], opts)
keymap("n", "<leader>r", [[<Cmd>Telescope resume<CR>]], opts)
keymap("n", "<leader>tg", [[<Cmd>Telescope tags<CR>]], opts)
keymap("n", "<leader>ty", [[<Cmd>Telescope symbols<CR>]], opts)
-- Setup
telescope.setup({ telescope.setup({
defaults = { defaults = {
prompt_prefix = "", prompt_prefix = "",

View File

@@ -1,7 +1,2 @@
-- https://github.com/folke/todo-comments.nvim -- https://github.com/folke/todo-comments.nvim
local status_ok, todo = pcall(require, "todo-comments") require("todo-comments").setup()
if not status_ok then
return
end
todo.setup()

View File

@@ -1,8 +1,17 @@
-- https://github.com/akinsho/toggleterm.nvim -- https://github.com/akinsho/toggleterm.nvim
local status_ok, toggleterm = pcall(require, "toggleterm") local toggleterm = require("toggleterm")
if not status_ok then local Terminal = require("toggleterm.terminal").Terminal
return local opts = { noremap = true, silent = true }
end
-- Keymaps
vim.keymap.set("n", "<M-g>", "<cmd>lua _LAZYGIT_TOGGLE()<CR>", opts)
vim.keymap.set("n", "<M-o>", "<cmd>lua _RANGER_TOGGLE()<CR>", opts)
vim.keymap.set("n", "<leader>lg", "<cmd>lua _LAZYGIT_TOGGLE()<CR>", opts)
vim.keymap.set("n", "<leader>ncdu", "<cmd>lua _NCDU_TOGGLE()<CR>", opts)
vim.keymap.set("n", "<leader>node", "<cmd>lua _NODE_TOGGLE()<CR>", opts)
vim.keymap.set("n", "<leader>rg", "<cmd>lua _RANGER_TOGGLE()<CR>", opts)
vim.keymap.set("n", "<leader>top", "<cmd>lua _HTOP_TOGGLE()<CR>", opts)
vim.keymap.set("n", "<leader>y", "<cmd>lua _PYTHON_TOGGLE()<CR>", opts)
toggleterm.setup({ toggleterm.setup({
size = 20, size = 20,
@@ -42,16 +51,13 @@ end
vim.cmd("autocmd! TermOpen term://* lua set_terminal_keymaps()") vim.cmd("autocmd! TermOpen term://* lua set_terminal_keymaps()")
local Terminal = require("toggleterm.terminal").Terminal local lazygit = Terminal:new({ cmd = "lazygit", hidden = true })
local lazygit = Terminal:new({ local ranger = Terminal:new({ cmd = "ranger", hidden = true })
cmd = "lazygit", local tig = Terminal:new({ cmd = "tig", hidden = true })
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 ranger = Terminal:new({ local python = Terminal:new({ cmd = "python", hidden = true })
cmd = "ranger",
hidden = true,
})
function _LAZYGIT_TOGGLE() function _LAZYGIT_TOGGLE()
lazygit:toggle() lazygit:toggle()
@@ -61,60 +67,22 @@ function _RANGER_TOGGLE()
ranger:toggle() ranger:toggle()
end end
local tig = Terminal:new({
cmd = "tig",
hidden = true,
})
function _TIG_TOGGLE() function _TIG_TOGGLE()
tig:toggle() tig:toggle()
end end
local node = Terminal:new({
cmd = "node",
hidden = true,
})
function _NODE_TOGGLE() function _NODE_TOGGLE()
node:toggle() node:toggle()
end end
local ncdu = Terminal:new({
cmd = "ncdu",
hidden = true,
})
function _NCDU_TOGGLE() function _NCDU_TOGGLE()
ncdu:toggle() ncdu:toggle()
end end
local htop = Terminal:new({
cmd = "htop",
hidden = true,
})
function _HTOP_TOGGLE() function _HTOP_TOGGLE()
htop:toggle() htop:toggle()
end end
local python = Terminal:new({
cmd = "python",
hidden = true,
})
function _PYTHON_TOGGLE() function _PYTHON_TOGGLE()
python:toggle() python:toggle()
end end
local keymap = vim.keymap.set
local opts = { noremap = true, silent = true }
-- Keymaps
keymap("n", "<M-g>", "<cmd>lua _LAZYGIT_TOGGLE()<CR>", opts)
keymap("n", "<M-o>", "<cmd>lua _RANGER_TOGGLE()<CR>", opts)
keymap("n", "<leader>lg", "<cmd>lua _LAZYGIT_TOGGLE()<CR>", opts)
keymap("n", "<leader>ncdu", "<cmd>lua _NCDU_TOGGLE()<CR>", opts)
keymap("n", "<leader>node", "<cmd>lua _NODE_TOGGLE()<CR>", opts)
keymap("n", "<leader>rg", "<cmd>lua _RANGER_TOGGLE()<CR>", opts)
keymap("n", "<leader>top", "<cmd>lua _HTOP_TOGGLE()<CR>", opts)
keymap("n", "<leader>y", "<cmd>lua _PYTHON_TOGGLE()<CR>", opts)

View File

@@ -1,10 +1,5 @@
-- https://github.com/nvim-treesitter/nvim-treesitter/ -- https://github.com/nvim-treesitter/nvim-treesitter/
local status_ok, configs = pcall(require, "nvim-treesitter.configs") require("nvim-treesitter.configs").setup({
if not status_ok then
return
end
configs.setup({
ensure_installed = "all", ensure_installed = "all",
sync_install = false, sync_install = false,
ignore_install = { "" }, -- List of parsers to ignore installing ignore_install = { "" }, -- List of parsers to ignore installing

View File

@@ -1,20 +1,12 @@
-- https://github.com/kevinhwang91/nvim-ufo -- 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 } local opts = { noremap = true, silent = true }
-- Options
vim.o.foldcolumn = "1" vim.o.foldcolumn = "1"
vim.o.foldlevel = 99 vim.o.foldlevel = 99
vim.o.foldlevelstart = 99 vim.o.foldlevelstart = 99
vim.o.foldenable = true 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 require("ufo").setup()
keymap("n", "zR", require("ufo").openAllFolds, opts)
keymap("n", "zM", require("ufo").closeAllFolds, opts)

View File

@@ -1,3 +1,2 @@
-- https://github.com/ruanyl/vim-gh-line -- https://github.com/ruanyl/vim-gh-line
vim.g.gh_github_domain = "source.xing.com" vim.g.gh_github_domain = "source.xing.com"

View File

@@ -1,15 +1,13 @@
-- https://github.com/preservim/vimux -- https://github.com/preservim/vimux
local keymap = vim.keymap.set
local opts = { noremap = true, silent = true } local opts = { noremap = true, silent = true }
vim.g.VimuxHeight = "30" vim.g.VimuxHeight = "30"
vim.g.VimuxOrientation = "h" vim.g.VimuxOrientation = "h"
vim.g.VimuxUseNearestPane = 0 vim.g.VimuxUseNearestPane = 0
-- Keymaps vim.keymap.set("n", "<leader>vt", [[<cmd>VimuxTogglePane<CR>]], opts)
keymap("n", "<leader>vt", [[<cmd>VimuxTogglePane<CR>]], opts) vim.keymap.set("n", "<leader>vp", [[<cmd>VimuxPromptCommand<CR>]], opts)
keymap("n", "<leader>vp", [[<cmd>VimuxPromptCommand<CR>]], opts) vim.keymap.set("n", "<leader>vl", [[<cmd>VimuxRunLastCommand<CR>]], opts)
keymap("n", "<leader>vl", [[<cmd>VimuxRunLastCommand<CR>]], opts) vim.keymap.set("n", "<leader>vj", [[<cmd>RunJest<CR>]], opts)
keymap("n", "<leader>vj", [[<cmd>RunJest<CR>]], opts) vim.keymap.set("n", "<leader>vjb", [[<cmd>RunJestOnBuffer<CR>]], opts)
keymap("n", "<leader>vjb", [[<cmd>RunJestOnBuffer<CR>]], opts) vim.keymap.set("n", "<leader>vjf", [[<cmd>RunJestFocused<CR>]], opts)
keymap("n", "<leader>vjf", [[<cmd>RunJestFocused<CR>]], opts)

View File

@@ -1,8 +1,5 @@
-- https://github.com/folke/which-key.nvim -- https://github.com/folke/which-key.nvim
local status_ok, which_key = pcall(require, "which-key") local which_key = require("which-key")
if not status_ok then
return
end
local mappings = { local mappings = {
b = { "<CMD>Telescope buffers<CR>", "Buffers" }, b = { "<CMD>Telescope buffers<CR>", "Buffers" },

View File

@@ -1,10 +1,5 @@
-- https://github.com/folke/zen-mode.nvim -- https://github.com/folke/zen-mode.nvim
local status_ok, zenmode = pcall(require, "zen-mode") require("zen-mode").setup({
if not status_ok then
return
end
zenmode.setup({
window = { window = {
backdrop = 0.98, backdrop = 0.98,
width = 80, width = 80,

View File

@@ -1,6 +1,10 @@
local keymap = vim.keymap.set
local opts = { noremap = true, silent = true } local opts = { noremap = true, silent = true }
local cfg = vim.fn.stdpath("config")
-- Toggle between soft wrap and no wrap
vim.keymap.set("n", "<leader>tw", [[<cmd>call ToggleWrap()<CR>]], opts)
-- Toggle between soft wrap and no wrap
vim.keymap.set("n", "<leader>cc", [[<cmd>call ToggleColorColumn()<CR>]], opts)
vim.cmd([[ vim.cmd([[
function! ToggleWrap() function! ToggleWrap()
@@ -42,10 +46,3 @@ function! SpellDe()
set spellfile=~/.config/nvim/spell/de.utf-8.add set spellfile=~/.config/nvim/spell/de.utf-8.add
endfunction endfunction
]]) ]])
-- Keymaps
-- Toggle between soft wrap and no wrap
keymap("n", "<leader>tw", [[<cmd>call ToggleWrap()<CR>]], opts)
-- Toggle between soft wrap and no wrap
keymap("n", "<leader>tcc", [[<cmd>call ToggleColorColumn()<CR>]], opts)

View File

@@ -1,162 +1,161 @@
local keymap = vim.keymap.set
local opts = { noremap = true, silent = true } local opts = { noremap = true, silent = true }
--- Remap space as <leader> key --- Remap space as <leader> key
keymap("", "<space>", "<Nop>", opts) vim.keymap.set("", "<space>", "<Nop>", opts)
vim.g.mapleader = " " vim.g.mapleader = " "
vim.g.maplocalleader = " " vim.g.maplocalleader = " "
-- Quick toggle between buffers -- Quick toggle between buffers
keymap("n", "<leader>j", ":b#<CR>", opts) vim.keymap.set("n", "<leader>j", ":b#<CR>", opts)
-- Add semicolon or comma to the end of the line -- Add semicolon or comma to the end of the line
keymap("n", ";;", "A;<ESC>", opts) vim.keymap.set("n", ";;", "A;<ESC>", opts)
keymap("n", ",,", "A,<ESC>", opts) vim.keymap.set("n", ",,", "A,<ESC>", opts)
-- Maintain the cursor position when yanking a visual selection -- 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 -- Delete last character of line
keymap("n", "<leader>x", "$x", opts) vim.keymap.set("n", "<leader>x", "$x", opts)
-- Do not yank with x -- 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 -- Open vim config in a new buffer, reload vim config
keymap("n", "<leader>ve", "<cmd>e $MYVIMRC<CR>", opts) vim.keymap.set("n", "<leader>ve", "<cmd>e $MYVIMRC<CR>", opts)
keymap("n", "<leader>vr", "<cmd>source $MYVIMRC<CR>", opts) vim.keymap.set("n", "<leader>vr", "<cmd>source $MYVIMRC<CR>", opts)
-- Increment/decrement -- Increment/decrement
keymap("n", "+", "<C-a>", opts) vim.keymap.set("n", "+", "<C-a>", opts)
keymap("n", "-", "<C-x>", opts) vim.keymap.set("n", "-", "<C-x>", opts)
-- Splits -- Splits
keymap("n", "ss", ":split<CR><C-w>w", opts) vim.keymap.set("n", "ss", ":split<CR><C-w>w", opts)
keymap("n", "sv", ":vsplit<CR><C-w>w", opts) vim.keymap.set("n", "sv", ":vsplit<CR><C-w>w", opts)
-- Select all -- Select all
keymap("n", "<C-a>", "gg<S-v>G", opts) vim.keymap.set("n", "<C-a>", "gg<S-v>G", opts)
-- Delete current buffer -- Delete current buffer
keymap("n", "<leader>q", ":Bdelete<CR>", opts) vim.keymap.set("n", "<leader>q", ":Bdelete<CR>", opts)
-- Delete all buffers -- Delete all buffers
keymap("n", "<leader>X", ":bufdo bdelete<CR>", opts) vim.keymap.set("n", "<leader>X", ":bufdo bdelete<CR>", opts)
-- Allow gf to open non-existent files -- Allow gf to open non-existent files
keymap("", "gf", ":edit <cfile><CR>", opts) vim.keymap.set("", "gf", ":edit <cfile><CR>", opts)
-- Reselect visual selection after indenting -- Reselect visual selection after indenting
keymap("v", "<", "<gv", opts) vim.keymap.set("v", "<", "<gv", opts)
keymap("v", ">", ">gv", opts) vim.keymap.set("v", ">", ">gv", opts)
-- Set spell checker to `s` -- Set spell checker to `s`
-- zg (good), zG (good temp), zw (wrong), zW (wrong temp) -- zg (good), zG (good temp), zw (wrong), zW (wrong temp)
keymap("n", "<leader>rs", ":set spell!<CR>", opts) vim.keymap.set("n", "<leader>rs", ":set spell!<CR>", opts)
-- Switch off highlighting -- Switch off highlighting
keymap("n", "<leader>h", ":nohlsearch<CR>", opts) vim.keymap.set("n", "<leader>h", ":nohlsearch<CR>", opts)
-- Toggle list -- Toggle list
keymap("n", "<leader>l", ":set list!<CR>", opts) vim.keymap.set("n", "<leader>l", ":set list!<CR>", opts)
-- Indent the whole source code -- Indent the whole source code
keymap("n", "<leader>pf", "gg=G''", opts) vim.keymap.set("n", "<leader>pf", "gg=G''", opts)
-- Reverse the mark mapping -- Reverse the mark mapping
keymap("n", "'", "`", opts) vim.keymap.set("n", "'", "`", opts)
keymap("n", "`", "'", opts) vim.keymap.set("n", "`", "'", opts)
-- Visuall select of just pasted content -- Visuall select of just pasted content
keymap("n", "gP", "`[v`]", opts) vim.keymap.set("n", "gP", "`[v`]", opts)
keymap("n", "gy", "`[v`]y", opts) vim.keymap.set("n", "gy", "`[v`]y", opts)
-- When text is wrapped, move by terminal rows, not lines, unless a count is provided -- When text is wrapped, move by terminal rows, not lines, unless a count is provided
keymap("n", "<expr> j", "(v:count == 0 ? 'gj' : 'j')", opts) vim.keymap.set("n", "<expr> j", "(v:count == 0 ? 'gj' : 'j')", opts)
keymap("n", "<expr> k", "(v:count == 0 ? 'gk' : 'k')", opts) vim.keymap.set("n", "<expr> k", "(v:count == 0 ? 'gk' : 'k')", opts)
-- Open a quickfix window for the last search -- Open a quickfix window for the last search
keymap("n", "<leader>?", ":execute 'vimgrep /'.@/.'/g %'<CR>:copen<CR>", opts) vim.keymap.set("n", "<leader>?", ":execute 'vimgrep /'.@/.'/g %'<CR>:copen<CR>", opts)
-- Faster linewise scrolling -- Faster linewise scrolling
keymap("n", "<C-e>", "3<C-e>", opts) vim.keymap.set("n", "<C-e>", "3<C-e>", opts)
keymap("n", "<C-y>", "3<C-y>", opts) vim.keymap.set("n", "<C-y>", "3<C-y>", opts)
-- Keep the window centered -- Keep the window centered
keymap("n", "G", "Gzzzv", opts) vim.keymap.set("n", "G", "Gzzzv", opts)
keymap("n", "n", "nzzzv", opts) vim.keymap.set("n", "n", "nzzzv", opts)
keymap("n", "N", "Nzzzv", opts) vim.keymap.set("n", "N", "Nzzzv", opts)
keymap("n", "<C-d>", "<C-d>zz", opts) vim.keymap.set("n", "<C-d>", "<C-d>zz", opts)
keymap("n", "<C-u>", "<C-u>zz", opts) vim.keymap.set("n", "<C-u>", "<C-u>zz", opts)
-- Copy to the end of the line -- Copy to the end of the line
keymap("n", "Y", "yg$", opts) vim.keymap.set("n", "Y", "yg$", opts)
-- Close all buffers -- Close all buffers
keymap("n", "XX", ":qa<CR>", opts) vim.keymap.set("n", "XX", ":qa<CR>", opts)
-- Add lines in NORMAL Mode -- Add lines in NORMAL Mode
keymap("n", "gN", "o<ESC>k", opts) vim.keymap.set("n", "gN", "o<ESC>k", opts)
keymap("n", "gNN", "O<ESC>j", opts) vim.keymap.set("n", "gNN", "O<ESC>j", opts)
-- Change to the folder of the current file -- Change to the folder of the current file
keymap("n", "<leader>cf", ":cd %:p:h<CR>:pwd<CR>", opts) vim.keymap.set("n", "<leader>cf", ":cd %:p:h<CR>:pwd<CR>", opts)
-- Reformat a line into a block -- Reformat a line into a block
keymap("n", "<leader>rq", "gqip", opts) vim.keymap.set("n", "<leader>rq", "gqip", opts)
-- Reformat a block into a line -- Reformat a block into a line
keymap("n", "<leader>rqq", "vipJ", opts) vim.keymap.set("n", "<leader>rqq", "vipJ", opts)
-- Easier split navigation -- Easier split navigation
keymap("n", "<C-J>", "<C-W><C-K>", opts) vim.keymap.set("n", "<C-J>", "<C-W><C-K>", opts)
keymap("n", "<C-K>", "<C-W><C-L>", opts) vim.keymap.set("n", "<C-K>", "<C-W><C-L>", opts)
keymap("n", "<C-L>", "<C-W><C-H>", opts) vim.keymap.set("n", "<C-L>", "<C-W><C-H>", opts)
keymap("n", "<C-H>", "<C-W><C-H>", opts) vim.keymap.set("n", "<C-H>", "<C-W><C-H>", opts)
-- Resize with arrows -- Resize with arrows
keymap("n", "<C-M-Up>", ":resize +2<CR>", opts) vim.keymap.set("n", "<C-M-Up>", ":resize +2<CR>", opts)
keymap("n", "<C-M-Down>", ":resize -2<CR>", opts) vim.keymap.set("n", "<C-M-Down>", ":resize -2<CR>", opts)
keymap("n", "<C-M-Left>", ":vertical resize +2<CR>", opts) vim.keymap.set("n", "<C-M-Left>", ":vertical resize +2<CR>", opts)
keymap("n", "<C-M-Right>", ":vertical resize -2<CR>", opts) vim.keymap.set("n", "<C-M-Right>", ":vertical resize -2<CR>", opts)
-- Stay in indent mode -- Stay in indent mode
keymap("v", "<", "<gv", opts) vim.keymap.set("v", "<", "<gv", opts)
keymap("v", ">", ">gv", opts) vim.keymap.set("v", ">", ">gv", opts)
-- Move text up and down -- Move text up and down
keymap("v", "<A-j>", ":m .+1<CR>==", opts) vim.keymap.set("v", "<A-j>", ":m .+1<CR>==", opts)
keymap("v", "<A-k>", ":m .-2<CR>==", opts) vim.keymap.set("v", "<A-k>", ":m .-2<CR>==", opts)
-- Navigate buffers -- Navigate buffers
--[[ keymap("n", "<S-l>", ":bnext<CR>", opts) ]] --[[ vim.keymap.set("n", "<S-l>", ":bnext<CR>", opts) ]]
--[[ keymap("n", "<S-h>", ":bprevious<CR>", opts) ]] --[[ vim.keymap.set("n", "<S-h>", ":bprevious<CR>", opts) ]]
-- Remap Jump to Tag -- Remap Jump to Tag
keymap("n", "ü", "<C-]>", opts) vim.keymap.set("n", "ü", "<C-]>", opts)
keymap("n", "Ü", "<C-O>", opts) vim.keymap.set("n", "Ü", "<C-O>", opts)
-- Open for Markdown in iA Writer -- Open for Markdown in iA Writer
keymap("n", "<leader>ia", ":silent !open -a iA\\ Writer.app '%:p'<CR>", opts) vim.keymap.set("n", "<leader>ia", ":silent !open -a iA\\ Writer.app '%:p'<CR>", opts)
-- Custom Text-Objects -- Custom Text-Objects
keymap("o", "il", ":<c-u>normal! $v^<CR>", opts) vim.keymap.set("o", "il", ":<c-u>normal! $v^<CR>", opts)
keymap("x", "il", ":<c-u>normal! $v^<CR>", opts) vim.keymap.set("x", "il", ":<c-u>normal! $v^<CR>", opts)
keymap("o", "al", ":<c-u>normal! $v0<CR>", opts) vim.keymap.set("o", "al", ":<c-u>normal! $v0<CR>", opts)
keymap("x", "al", ":<c-u>normal! $v0<CR>", opts) vim.keymap.set("x", "al", ":<c-u>normal! $v0<CR>", opts)
-- LSP formatting -- LSP formatting
keymap("n", "<leader>o", "<cmd>lua vim.lsp.buf.format()<CR>", opts) vim.keymap.set("n", "<leader>o", "<cmd>lua vim.lsp.buf.format()<CR>", opts)
-- Manual Prettier -- Manual Prettier
keymap("n", "<leader>P", "<cmd>Prettier<CR>", opts) vim.keymap.set("n", "<leader>P", "<cmd>Prettier<CR>", opts)
-- Get the filename and path of current file -- Get the filename and path of current file
keymap("n", "<leader>kn", ":let @+=@%<CR>", opts) vim.keymap.set("n", "<leader>kn", ":let @+=@%<CR>", opts)
-- Remove console.log statements -- Remove console.log statements
keymap("n", "<leader>kc", ":g/console.log/d<CR>", opts) vim.keymap.set("n", "<leader>kc", ":g/console.log/d<CR>", opts)
-- Convert Markdown to HTML and copy to Clipboard -- Convert Markdown to HTML and copy to Clipboard
keymap("v", "<leader>kp", ":'<,'> w !pandoc --no-highlight --wrap=none | pbcopy <CR>", opts) vim.keymap.set("v", "<leader>kp", ":'<,'> w !pandoc --no-highlight --wrap=none | pbcopy <CR>", opts)

View File

@@ -128,7 +128,6 @@ return packer.startup(function(use)
use("MattesGroeger/vim-bookmarks") -- Bookmarks use("MattesGroeger/vim-bookmarks") -- Bookmarks
use("folke/which-key.nvim") -- Display possible keybindings use("folke/which-key.nvim") -- Display possible keybindings
use("mrjones2014/legendary.nvim") -- Legend for keymaps, commands, and autocommands use("mrjones2014/legendary.nvim") -- Legend for keymaps, commands, and autocommands
use("karb94/neoscroll.nvim") -- Smooth scrolling
use("APZelos/blamer.nvim") -- Git Blame use("APZelos/blamer.nvim") -- Git Blame
use("tpope/vim-fugitive") -- Git plugin use("tpope/vim-fugitive") -- Git plugin
use("elijahmanor/export-to-vscode.nvim") -- Export active Buffers to Visual Studio Code 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("pwntester/octo.nvim") -- GitHub in Neovim
use("nvim-pack/nvim-spectre") -- Search and replace use("nvim-pack/nvim-spectre") -- Search and replace
use("stevearc/dressing.nvim") -- Improve the default vim.ui interfaces 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("tpope/vim-eunuch") -- UNIX Shell commands
use("folke/twilight.nvim") -- Dim inactive code use("folke/twilight.nvim") -- Dim inactive code
use("ray-x/guihua.lua") -- Lua GUI lib use("ray-x/guihua.lua") -- Lua GUI lib