1
Fork 0

Tweaked vim config a bunch

This commit is contained in:
Matei Adriel 2023-08-30 13:08:50 +03:00
parent c4e8869820
commit f76340f145
No known key found for this signature in database
7 changed files with 107 additions and 113 deletions

View file

@ -67,10 +67,9 @@ I feel like macro recording is a rare thing, so I moved it to `yq/yQ`. This free
The `<leader>f` namespace contains keybinds which search for a specific filetype. The `<leader>f` namespace contains keybinds which search for a specific filetype.
| Keybind | Description | Plugins | | Keybind | Description | Plugins |
| ----------- | ------------------------ | ---------------------- | | ----------- | -------------------- | --------- |
| C-p | Find files | | | C-p | Find files | |
| C-f | Grep in project | | | C-f | Grep in project | |
| C-F | Interactive file broswer | telescope-file-browser |
| \<leader>d | Diagnostics | lspconfig | | \<leader>d | Diagnostics | lspconfig |
| \<leader>t | Show builtin pickers | | | \<leader>t | Show builtin pickers | |
| \<leader>ft | Typescript Files | | | \<leader>ft | Typescript Files | |
@ -204,13 +203,16 @@ The following keybinds are available only when running inside firenvim:
| gc | Comment selection | nvim-comment | | gc | Comment selection | nvim-comment |
| C-g | Open neo[g]it | neogit | | C-g | Open neo[g]it | neogit |
| \<leader>yg | [Y]ank remote [g]it url | gitlinker | | \<leader>yg | [Y]ank remote [g]it url | gitlinker |
| cs[a][b] | Change surrounding pair from a to b | vim-surround | | <tab>r[a][b] | Change surrounding pair from a to b | mini.surround |
| ds[a] | Delete surrounding pair of a | vim-surround | | <tab>d[a] | Delete surrounding pair of a | mini.surround |
| ys[m][a] | Surround the motion m with a | vim-surround | | <tab>s[m][a] | Surround the motion m with a | mini.surround |
| S[a] | Surround selected code with a | vim-surround | | <tab>s[a] | Surround selected code with a | mini.surround |
| s | Initialize forward [s]earch | leap | | C-F | Interactive file broswer | mini.files |
| S | Initialize backwards [s]earch | leap | | s | Flash [s]earch | flash |
| gs | Initialize other window [s]earch | leap | | S | Flash treesitter [s]elect | flash |
| r | remote [f]lash | flash |
| R | remote treesitter [f]lash | flash |
| C-s | Toggle flash [s]earch | flash |
| C-n | Open filetree | nvim-tree | | C-n | Open filetree | nvim-tree |
| \<leader>p | [P]aste imge from clipboard | clipboard-image.nvim | | \<leader>p | [P]aste imge from clipboard | clipboard-image.nvim |
| \<leader>L | [L]azy ui | lazy.nvim | | \<leader>L | [L]azy ui | lazy.nvim |

View file

@ -1,7 +1,6 @@
{ {
"LuaSnip": { "branch": "master", "commit": "409535b8fc54c650eb845b0c35e0cc7f08810284" }, "LuaSnip": { "branch": "master", "commit": "409535b8fc54c650eb845b0c35e0cc7f08810284" },
"abbreinder.nvim": { "branch": "main", "commit": "5b2b5ff08a9ada42238d733aeebc6d3d96314d77" }, "alpha-nvim": { "branch": "main", "commit": "63a860e7ed3ae41ee92481ea65a48fb35431ae21" },
"abbremand.nvim": { "branch": "main", "commit": "d633341f632b0b2666dfc6dfe6b9842ba1610a1d" },
"catppuccin": { "branch": "main", "commit": "490078b1593c6609e6a50ad5001e7902ea601824" }, "catppuccin": { "branch": "main", "commit": "490078b1593c6609e6a50ad5001e7902ea601824" },
"clipboard-image.nvim": { "branch": "main", "commit": "af8fdaad7e6fed0741e18dbf2f57bdc7494adaee" }, "clipboard-image.nvim": { "branch": "main", "commit": "af8fdaad7e6fed0741e18dbf2f57bdc7494adaee" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
@ -11,14 +10,12 @@
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
"crates.nvim": { "branch": "main", "commit": "d5caf28aba49e81ac4099426231f3cf3c151013a" }, "crates.nvim": { "branch": "main", "commit": "d5caf28aba49e81ac4099426231f3cf3c151013a" },
"dashboard-nvim": { "branch": "master", "commit": "c17d3210b3dec8798b4fc82a11c542989251f85d" },
"dhall-vim": { "branch": "master", "commit": "68500ef46ff3706f46c99db3be7a0c8abcf6a3ae" }, "dhall-vim": { "branch": "master", "commit": "68500ef46ff3706f46c99db3be7a0c8abcf6a3ae" },
"dressing.nvim": { "branch": "master", "commit": "6bde51adabba06f7fd4a469885a85f36d78a5f52" }, "dressing.nvim": { "branch": "master", "commit": "6bde51adabba06f7fd4a469885a85f36d78a5f52" },
"fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" }, "fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" },
"flash.nvim": { "branch": "main", "commit": "967117690bd677cb7b6a87f0bc0077d2c0be3a27" }, "flash.nvim": { "branch": "main", "commit": "967117690bd677cb7b6a87f0bc0077d2c0be3a27" },
"github-actions-yaml.vim": { "branch": "master", "commit": "f2f16243447cea174daa6b4a9ffd3ff9213814ef" }, "github-actions-yaml.vim": { "branch": "master", "commit": "f2f16243447cea174daa6b4a9ffd3ff9213814ef" },
"gitlinker.nvim": { "branch": "master", "commit": "cc59f732f3d043b626c8702cb725c82e54d35c25" }, "gitlinker.nvim": { "branch": "master", "commit": "cc59f732f3d043b626c8702cb725c82e54d35c25" },
"glow.nvim": { "branch": "main", "commit": "8942dfb05794f436af4fbc90a34393f1fd36f361" },
"harpoon": { "branch": "master", "commit": "21f4c47c6803d64ddb934a5b314dcb1b8e7365dc" }, "harpoon": { "branch": "master", "commit": "21f4c47c6803d64ddb934a5b314dcb1b8e7365dc" },
"hydra.nvim": { "branch": "master", "commit": "3ced42c0b6a6c85583ff0f221635a7f4c1ab0dd0" }, "hydra.nvim": { "branch": "master", "commit": "3ced42c0b6a6c85583ff0f221635a7f4c1ab0dd0" },
"hyprland-vim-syntax": { "branch": "main", "commit": "8488a24b50882da969979103b4d668c70e7995b9" }, "hyprland-vim-syntax": { "branch": "main", "commit": "8488a24b50882da969979103b4d668c70e7995b9" },
@ -27,7 +24,6 @@
"iron.nvim": { "branch": "master", "commit": "7f876ee3e1f4ea1e5284b1b697cdad5b256e8046" }, "iron.nvim": { "branch": "master", "commit": "7f876ee3e1f4ea1e5284b1b697cdad5b256e8046" },
"jupytext.vim": { "branch": "master", "commit": "32c1e37b2edf63a7e38d0deb92cc3f1462cc4dcd" }, "jupytext.vim": { "branch": "master", "commit": "32c1e37b2edf63a7e38d0deb92cc3f1462cc4dcd" },
"kmonad-vim": { "branch": "master", "commit": "37978445197ab00edeb5b731e9ca90c2b141723f" }, "kmonad-vim": { "branch": "master", "commit": "37978445197ab00edeb5b731e9ca90c2b141723f" },
"knap": { "branch": "main", "commit": "503010f541696e99ed5c62f658620e546cebf8b0" },
"kotlin-vim": { "branch": "master", "commit": "53fe045906df8eeb07cb77b078fc93acda6c90b8" }, "kotlin-vim": { "branch": "master", "commit": "53fe045906df8eeb07cb77b078fc93acda6c90b8" },
"lazy.nvim": { "branch": "main", "commit": "dac844ed617dda4f9ec85eb88e9629ad2add5e05" }, "lazy.nvim": { "branch": "main", "commit": "dac844ed617dda4f9ec85eb88e9629ad2add5e05" },
"lean.nvim": { "branch": "main", "commit": "67580fab5bed73920fa3fdd712fc8e805c389c3d" }, "lean.nvim": { "branch": "main", "commit": "67580fab5bed73920fa3fdd712fc8e805c389c3d" },
@ -36,6 +32,7 @@
"magma-nvim": { "branch": "main", "commit": "ff3deba8a879806a51c005e50782130246143d06" }, "magma-nvim": { "branch": "main", "commit": "ff3deba8a879806a51c005e50782130246143d06" },
"mind.nvim": { "branch": "master", "commit": "002137dd7cf97865ebd01b6a260209d2daf2da66" }, "mind.nvim": { "branch": "master", "commit": "002137dd7cf97865ebd01b6a260209d2daf2da66" },
"mini.files": { "branch": "main", "commit": "dea80a8147aa4e3025c34d2e2aaa6f2aeb7b21dd" }, "mini.files": { "branch": "main", "commit": "dea80a8147aa4e3025c34d2e2aaa6f2aeb7b21dd" },
"mini.operators": { "branch": "main", "commit": "15f137f28412517e2248d39cf0663bd3a87aa24a" },
"mini.surround": { "branch": "main", "commit": "9d1956b576d7051da3a483b251dfc778121c60db" }, "mini.surround": { "branch": "main", "commit": "9d1956b576d7051da3a483b251dfc778121c60db" },
"neoconf.nvim": { "branch": "main", "commit": "08f146d53e075055500dca35e93281faff95716b" }, "neoconf.nvim": { "branch": "main", "commit": "08f146d53e075055500dca35e93281faff95716b" },
"neodev.nvim": { "branch": "main", "commit": "9a5c0f0de5c15fba52d4fb83d425d3f4fa7abfa1" }, "neodev.nvim": { "branch": "main", "commit": "9a5c0f0de5c15fba52d4fb83d425d3f4fa7abfa1" },
@ -62,7 +59,6 @@
"rust-tools.nvim": { "branch": "master", "commit": "0cc8adab23117783a0292a0c8a2fbed1005dc645" }, "rust-tools.nvim": { "branch": "master", "commit": "0cc8adab23117783a0292a0c8a2fbed1005dc645" },
"scrap.nvim": { "branch": "main", "commit": "16db44ae9403ec9c4b140394f294475d1af80a18" }, "scrap.nvim": { "branch": "main", "commit": "16db44ae9403ec9c4b140394f294475d1af80a18" },
"smart-splits.nvim": { "branch": "master", "commit": "7aad6019dee974a01333523a5b8e122b7e7da454" }, "smart-splits.nvim": { "branch": "master", "commit": "7aad6019dee974a01333523a5b8e122b7e7da454" },
"telescope-file-browser.nvim": { "branch": "master", "commit": "ad7b637c72549713b9aaed7c4f9c79c62bcbdff0" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "9bc8237565ded606e6c366a71c64c0af25cd7a50" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "9bc8237565ded606e6c366a71c64c0af25cd7a50" },
"telescope.nvim": { "branch": "master", "commit": "776b509f80dd49d8205b9b0d94485568236d1192" }, "telescope.nvim": { "branch": "master", "commit": "776b509f80dd49d8205b9b0d94485568236d1192" },
"typst.vim": { "branch": "main", "commit": "6a99324a138c2da69589a8ab2e49375774e43d77" }, "typst.vim": { "branch": "main", "commit": "6a99324a138c2da69589a8ab2e49375774e43d77" },

View file

@ -1,44 +1,66 @@
local env = require("my.helpers.env") local env = require("my.helpers.env")
local M = { local M = {
"glepnir/dashboard-nvim", "goolord/alpha-nvim",
event = "VimEnter", dependencies = { "nvim-tree/nvim-web-devicons" },
opts = { config = function()
theme = "hyper", local theme = require("alpha.themes.dashboard")
config = { theme.opts.width = 70
week_header = { enable = true }, theme.opts.position = "center"
project = { enable = false }, theme.section.buttons.val = {}
-- TODO: actually customize these
shortcut = { -- See [the header generator](https://patorjk.com/software/taag/#p=display&v=0&f=ANSI%20Shadow&t=NEOVim%20%3A3)
{ theme.section.header.opts.hl = "AlphaHeader"
desc = " Update", theme.section.header.val = [[
group = "@property",
action = "Lazy update",
key = "u",
},
{
desc = " Files",
group = "Label", ]]
action = "Telescope find_files",
key = "f", local footer = function()
}, local version = "🚀 "
{ .. vim.version().major
desc = " Apps", .. "."
group = "DiagnosticHint", .. vim.version().minor
action = "Telescope app", .. "."
key = "a", .. vim.version().patch
}, local lazy_ok, lazy = pcall(require, "lazy")
{ if lazy_ok then
desc = " dotfiles", local total_plugins = lazy.stats().count .. " Plugins"
group = "Number", local startuptime = (
action = "Telescope dotfiles", math.floor(lazy.stats().startuptime * 100 + 0.5) / 100
key = "d", )
}, return version
}, .. " — 🧰 "
}, .. total_plugins
}, .. " — 🕐 "
.. startuptime
.. "ms"
else
return version
end
end
vim.api.nvim_create_autocmd("User", {
pattern = "LazyVimStarted",
callback = function()
theme.section.footer.val = footer()
vim.cmd("AlphaRedraw")
end,
desc = "Footer for Alpha",
})
theme.section.footer.opts.hl = "AlphaFooter"
theme.section.header.opts.hl = "AlphaHeader"
theme.section.buttons.opts.hl = "AlphaButton"
require("alpha").setup(theme.config)
end,
lazy = false,
cond = env.vscode.not_active() and env.firenvim.not_active(), cond = env.vscode.not_active() and env.firenvim.not_active(),
dependencies = { { "nvim-tree/nvim-web-devicons" } },
} }
return M return M

View file

@ -96,11 +96,10 @@ return {
}, },
-- Helper libs -- Helper libs
{
"nvim-lua/plenary.nvim", "nvim-lua/plenary.nvim",
},
"MunifTanjim/nui.nvim", "MunifTanjim/nui.nvim",
"nvim-tree/nvim-web-devicons", -- nice looking icons
"mateiadrielrafael/scrap.nvim", -- vim-abolish rewrite
{ {
"terrortylor/nvim-comment", "terrortylor/nvim-comment",
@ -110,9 +109,6 @@ return {
end, end,
}, },
-- nice looking icons
"nvim-tree/nvim-web-devicons",
{ {
-- easly switch between tmux and vim panes -- easly switch between tmux and vim panes
"christoomey/vim-tmux-navigator", "christoomey/vim-tmux-navigator",
@ -129,14 +125,6 @@ return {
cond = env.vscode.not_active() and env.firenvim.not_active(), cond = env.vscode.not_active() and env.firenvim.not_active(),
}, },
{
-- smooth scrolling
"psliwka/vim-smoothie",
-- enabled = env.neovide.not_active(),
enabled = false,
event = "VeryLazy",
},
{ {
-- show progress for lsp stuff -- show progress for lsp stuff
"j-hui/fidget.nvim", "j-hui/fidget.nvim",
@ -162,25 +150,6 @@ return {
enabled = false, enabled = false,
}, },
{
-- reminds you of abbreviations
"0styx0/abbreinder.nvim",
dependencies = "0styx0/abbremand.nvim",
event = "InsertEnter",
},
{
-- md preview (in terminal)
"ellisonleao/glow.nvim",
cmd = "Glow",
cond = env.vscode.not_active(),
},
{
"frabjous/knap", -- md preview
cond = env.vscode.not_active(),
},
{ {
-- automatically set options based on current file -- automatically set options based on current file
"tpope/vim-sleuth", "tpope/vim-sleuth",
@ -188,15 +157,11 @@ return {
cond = env.vscode.not_active(), cond = env.vscode.not_active(),
}, },
-- vim-abolish rewrite
"mateiadrielrafael/scrap.nvim",
{ {
"ruifm/gitlinker.nvim", -- generate permalinks for code -- generate permalinks for code
"ruifm/gitlinker.nvim",
dependencies = { "nvim-lua/plenary.nvim" }, dependencies = { "nvim-lua/plenary.nvim" },
opts = { opts = { mappings = "<leader>yg" },
mappings = "<leader>yg",
},
init = function() init = function()
local status, wk = pcall(require, "which-key") local status, wk = pcall(require, "which-key")
@ -225,15 +190,16 @@ return {
-- Live command preview for stuff like :norm -- Live command preview for stuff like :norm
{ {
"smjonas/live-command.nvim", "smjonas/live-command.nvim",
opts = { config = function()
require("live-command").setup({
commands = { commands = {
Norm = { cmd = "norm" }, Norm = { cmd = "norm" },
}, },
}, })
end,
event = "VeryLazy", event = "VeryLazy",
cond = false, cond = false,
}, },
{ {
"mbbill/undotree", "mbbill/undotree",
cmd = "UndotreeToggle", cmd = "UndotreeToggle",

View file

@ -1,9 +1,11 @@
local K = require("my.keymaps") local K = require("my.keymaps")
local env = require("my.helpers.env")
local M = { local M = {
"echasnovski/mini.files", "echasnovski/mini.files",
version = "main", version = "main",
keys = { "<C-S-F>" }, event = "VeryLazy",
cond = env.vscode.not_active() and env.firenvim.not_active(),
} }
function M.config() function M.config()
@ -11,11 +13,9 @@ function M.config()
files.setup({ files.setup({
windows = { windows = {
preview = true, preview = false,
},
mappings = {
reveal_cwd = "R",
}, },
mappings = {},
}) })
K.nmap("<C-S-F>", function() K.nmap("<C-S-F>", function()

View file

@ -0,0 +1,8 @@
local M = {
"echasnovski/mini.operators",
version = false,
event = "VeryLazy",
opts = {},
}
return M