updated nvim config files
This commit is contained in:
parent
f0d29dcace
commit
4c649c892f
3
nvim/init.lua
Executable file → Normal file
3
nvim/init.lua
Executable file → Normal file
@ -1,2 +1 @@
|
||||
require "enrique.core"
|
||||
require "enrique.lazy"
|
||||
require('config.lazy')
|
||||
|
||||
90
nvim/lazy-lock.json
Executable file → Normal file
90
nvim/lazy-lock.json
Executable file → Normal file
@ -1,62 +1,34 @@
|
||||
{
|
||||
"Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" },
|
||||
"LuaSnip": { "branch": "master", "commit": "45db5addf8d0a201e1cf247cae4cdce605ad3768" },
|
||||
"aerial.nvim": { "branch": "master", "commit": "fa75fd0286788c6c5a65ec46aafbfaf7b7826b74" },
|
||||
"alpha-nvim": { "branch": "main", "commit": "b6f4129302db197a7249e67a90de3f2b676de13e" },
|
||||
"auto-session": { "branch": "main", "commit": "a90aa7730efa60fdcc7e00497a8f36d94a6da709" },
|
||||
"barbecue": { "branch": "main", "commit": "cd7e7da622d68136e13721865b4d919efd6325ed" },
|
||||
"bigfile.nvim": { "branch": "main", "commit": "33eb067e3d7029ac77e081cfe7c45361887a311a" },
|
||||
"bufferline.nvim": { "branch": "main", "commit": "0b2fd861eee7595015b6561dade52fb060be10c4" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||
"dart-tools.nvim": { "branch": "main", "commit": "34f4835d42213ab3fb85995296bf25bd0e8712fa" },
|
||||
"dracula.nvim": { "branch": "main", "commit": "3426d73411806f73b85f706b9b48123deeb0836c" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "c5775a888adbc50652cb370073fcfec963eca93e" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" },
|
||||
"flutter-tools.nvim": { "branch": "main", "commit": "ea1d398f543a54ba95357c3b8bb9d6f68eaec36c" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" },
|
||||
"guess-indent.nvim": { "branch": "main", "commit": "6cd61f7a600bb756e558627cd2e740302c58e32d" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "18603eb949eba08300799f64027af11ef922283f" },
|
||||
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
|
||||
"blink-emoji.nvim": { "branch": "master", "commit": "a77aebc092ebece1eed108f301452ae774d6b67a" },
|
||||
"blink.cmp": { "branch": "main", "commit": "cb5e346d9e0efa7a3eee7fd4da0b690c48d2a98e" },
|
||||
"conform.nvim": { "branch": "master", "commit": "372fc521f8421b7830ea6db4d6ea3bae1c77548c" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" },
|
||||
"flutter-tools.nvim": { "branch": "main", "commit": "6faf2c70bd56f1fe78620591a2bb73f4dc6f4870" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||
"fzf-lua": { "branch": "main", "commit": "b11467c3fbfe48e4a815e4909f5c4e5b413ce6d0" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
|
||||
"lspkind.nvim": { "branch": "master", "commit": "cff4ae321a91ee3473a92ea1a8c637e3a9510aec" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" },
|
||||
"mason-tool-installer.nvim": { "branch": "main", "commit": "c5e07b8ff54187716334d585db34282e46fa2932" },
|
||||
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
|
||||
"mini.icons": { "branch": "main", "commit": "2d89252993fec829b24720097a687412d10f6c85" },
|
||||
"neo-tree.nvim": { "branch": "v3.x", "commit": "29f7c215332ba95e470811c380ddbce2cebe2af4" },
|
||||
"neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" },
|
||||
"noice.nvim": { "branch": "main", "commit": "448bb9c524a7601035449210838e374a30153172" },
|
||||
"nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "fd2badc24e675f947162a16c124d395bde80dbd6" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" },
|
||||
"nvim-lint": { "branch": "master", "commit": "a7ce9c78a7c710c28bee56dfab10a5c0c80b7fb5" },
|
||||
"nvim-lsp-file-operations": { "branch": "master", "commit": "92a673de7ecaa157dd230d0128def10beb56d103" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "056f569f71e4b726323b799b9cfacc53653bceb3" },
|
||||
"nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" },
|
||||
"nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" },
|
||||
"nvim-osc52": { "branch": "main", "commit": "04cfaba1865ae5c53b6f887c3ca7304973824fb2" },
|
||||
"nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "6a3c6a42a6e24414bdf337b05a84a0ea013dd155" },
|
||||
"nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" },
|
||||
"nvim-ts-context-commentstring": { "branch": "main", "commit": "375c2d86cee6674afd75b4f727ce3a80065552f7" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "9793801f974bba70e4ac5d7eae6c4f5659993d8e" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" },
|
||||
"quickfixdd": { "branch": "master", "commit": "cc1adb7e7e9f4827cd655f6b1c05fadedaa87f45" },
|
||||
"substitute.nvim": { "branch": "main", "commit": "97f49d16f8eea7967d41db4f657dd63af53eeba1" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" },
|
||||
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "319c01b99b7a8c9ac2066bf0efd4d6ec68fef444" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "4b386e66a9599057587c30538d5e6192e3d1c181" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "6efc446226679fda0547c0fd6a7892fd5f5b15d8" },
|
||||
"vim-dadbod": { "branch": "master", "commit": "7888cb7164d69783d3dce4e0283decd26b82538b" },
|
||||
"vim-dadbod-completion": { "branch": "master", "commit": "880f7e9f2959e567c718d52550f9fae1aa07aa81" },
|
||||
"vim-dadbod-ui": { "branch": "master", "commit": "a5ff8bd69fcaf53cd24827b54492c8ce87806d18" },
|
||||
"vim-illuminate": { "branch": "master", "commit": "5eeb7951fc630682c322e88a9bbdae5c224ff0aa" },
|
||||
"vim-maximizer": { "branch": "master", "commit": "2e54952fe91e140a2e69f35f22131219fcd9c5f1" },
|
||||
"vim-tmux-navigator": { "branch": "master", "commit": "5b3c701686fb4e6629c100ed32e827edf8dad01e" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "bfec3d6bc0a9b0b2cb11644642f78c2c3915eef0" }
|
||||
"lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" },
|
||||
"mason-tool-installer.nvim": { "branch": "main", "commit": "1255518cb067e038a4755f5cb3e980f79b6ab89c" },
|
||||
"mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" },
|
||||
"mini.icons": { "branch": "main", "commit": "397ed3807e96b59709ef3292f0a3e253d5c1dc0a" },
|
||||
"mini.notify": { "branch": "main", "commit": "3a06b21dd0b335b95d125eae813276113b5e9ce7" },
|
||||
"mini.nvim": { "branch": "main", "commit": "0420076298c4457f200c2de468f65d080597a347" },
|
||||
"noice.nvim": { "branch": "main", "commit": "0427460c2d7f673ad60eb02b35f5e9926cf67c59" },
|
||||
"nui.nvim": { "branch": "main", "commit": "8d5b0b568517935d3c84f257f272ef004d9f5a59" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "94d0fec9135719e046903bbbbf8f39e3d3436d4e" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "94ea4f436d2b59c80f02e293466c374584f03b8c" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "ed373482db797bbf71bdff37a15c7555a84dce47" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "50b5b06bff13a9b4eab946de7c7033649a6618a1" },
|
||||
"oil.nvim": { "branch": "master", "commit": "685cdb4ffa74473d75a1b97451f8654ceeab0f4a" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
|
||||
"project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" },
|
||||
"smear-cursor.nvim": { "branch": "main", "commit": "8820b313e49a018c7d56fc309c51363c0e9ae653" },
|
||||
"substitute.nvim": { "branch": "main", "commit": "9db749a880e3dd3b0eb57f698aa8f1e1630e1f25" },
|
||||
"toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" },
|
||||
"tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" },
|
||||
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }
|
||||
}
|
||||
|
||||
120
nvim/lua/config/keymaps.lua
Normal file
120
nvim/lua/config/keymaps.lua
Normal file
@ -0,0 +1,120 @@
|
||||
local wk = require("which-key")
|
||||
|
||||
local function wkAdd(keys, func, desc, mode)
|
||||
mode = mode or "n"
|
||||
wk.add({ keys, func, desc = desc, mode = mode })
|
||||
end
|
||||
|
||||
local function wkGroup(keys, group, modes)
|
||||
modes = modes or { "n" }
|
||||
wk.add({ keys, group = group, mode = modes })
|
||||
end
|
||||
|
||||
-- NOTE misc keymaps
|
||||
wkAdd("jj", "<esc>", "Exit insert mode", "i")
|
||||
wkAdd("<leader><space>", "<cmd>nohl<cr>", "Clear search")
|
||||
wkAdd("<leader>n", "o<esc>", "Add new line")
|
||||
wkAdd("<leader>N", "O<esc>", "Add new line above")
|
||||
wkAdd("<leader>+", "<C-a>", "Increment number by 1")
|
||||
wkAdd("<leader>-", "<C-x>", "Decrement number by 1")
|
||||
wkAdd("<leader>W", "<C-w", "Window management")
|
||||
wkAdd("<leader>ee", "<cmd>Oil --float<cr>", "Open file manager")
|
||||
vim.keymap.set("t", "<Esc><Esc>", "<C-\\><C-n>", { desc = "Exit terminal mode" })
|
||||
|
||||
-- NOTE Surround
|
||||
wkGroup("<leader>w", "Wrap (quotes, brackets)")
|
||||
|
||||
-- NOTE search
|
||||
wkGroup("<leader>s", "Search")
|
||||
wkAdd("<leader>sf", "<cmd>FzfLua files<cr>", "Search files")
|
||||
wkAdd("<leader>sz", "<cmd>FzfLua builtin<cr>", "Search builtins")
|
||||
wkAdd("<leader>sb", "<cmd>FzfLua buffers<cr>", "Search buffers")
|
||||
wkAdd("<leader>sw", "<cmd>FzfLua live_grep<cr>", "Search word")
|
||||
wkAdd("<leader>s/", "<cmd>FzfLua grep_curbuf<cr>", "Search in current buffer")
|
||||
wkAdd("<leader>ss", "<cmd>FzfLua lsp_document_symbols<cr>", "Search document symbols")
|
||||
wkAdd("<leader>sS", "<cmd>FzfLua lsp_live_workspace_symbols<cr>", "Search workspace symbols")
|
||||
|
||||
-- NOTE files and buffers
|
||||
wkGroup("<leader>b", "Buffers")
|
||||
wkAdd("<leader>bw", "<cmd>w!<cr>", "Save current buffer")
|
||||
wkAdd("<leader>bW", "<cmd>wa!<cr>", "Save all buffers")
|
||||
wkAdd("<leader>bq", "<cmd>wq!<cr>", "Save and close current buffer")
|
||||
wkAdd("<leader>bQ", "<cmd>wqa!<cr>", "Save and close all buffers")
|
||||
wkAdd("<leader>bx", "<cmd>q!<cr>", "Exit current buffer without saving")
|
||||
wkAdd("<leader>bX", "<cmd>qa!<cr>", "Exit session without saving")
|
||||
wkAdd("<leader>bn", "]b", "Go to next buffer")
|
||||
wkAdd("<leader>bp", "[b", "Go to prev buffer")
|
||||
|
||||
-- NOTE Diagnostics
|
||||
wkGroup("<leader>d", "Diagnostics")
|
||||
wkAdd("<leader>dd", function()
|
||||
vim.diagnostic.open_float()
|
||||
end, "Show line diagnostics")
|
||||
wkAdd("<leader>dD", "<cmd>FzfLua diagnostics_document", "Show document diagnostics")
|
||||
wkAdd("<leader>dW", "<cmd>FzfLua lsp_workspace_diagnostics", "Show workspace diagnostics")
|
||||
wkAdd("<leader>dn", function()
|
||||
vim.diagnostic.goto_next()
|
||||
end, "Go to next diagnostic")
|
||||
wkAdd("<leader>dp", function()
|
||||
vim.diagnostic.goto_prev()
|
||||
end, "Go to next diagnostic")
|
||||
|
||||
-- NOTE Terminal
|
||||
wkGroup("<leader>t", "Terminal")
|
||||
wkAdd("<leader>tt", "<cmd>ToggleTerm 1 name='dev' direction='float'<cr>", "Toggle terminal")
|
||||
wkAdd("<leader>ta", "<cmd>ToggleTermToggleAll<cr>", "Toggle all terminals")
|
||||
wkAdd("<leader>th", "<cmd>ToggleTerm 1 name='dev' direction='horizontal'<cr>", "Open horizontal terminal")
|
||||
wkAdd("<leader>tv", "<cmd>ToggleTerm 1 name='dev' direction='vertical'<cr>", "Open vertical terminal")
|
||||
wkAdd("<leader>tp", "<cmd>ToggleTerm 80 name='Posting' direction='float'<cr>", "Open Posting CLI")
|
||||
wkAdd("<leader>tP", "<cmd>TermExec 80 name='Posting' cmd='posting' direction='float'<cr>", "Init Posting CLI")
|
||||
|
||||
-- NOTE Substitute
|
||||
local substitute = require("substitute")
|
||||
wkAdd("s", substitute.operator, "Substitute with motion")
|
||||
wkAdd("ss", substitute.line, "Substitute line")
|
||||
wkAdd("S", substitute.eol, "Substitute to end of line")
|
||||
wkAdd("s", substitute.visual, "Substitute in visual mode", "x")
|
||||
|
||||
wk.add({
|
||||
{ -- Flutter
|
||||
mode = { "n" },
|
||||
{ "<leader>F", group = "Flutter" },
|
||||
-- { "<leader>Ff", "<cmd>Telescope flutter commands<cr>", desc = "Show flutter commands" },
|
||||
{ "<leader>Fo", "<cmd>FlutterOutlineToggle<cr>", desc = "Show flutter outline" },
|
||||
{ "<leader>Fd", "<cmd>FlutterDevices<cr>", desc = "Show devices" },
|
||||
{ "<leader>Fe", "<cmd>FlutterEmulators<cr>", desc = "Show emulators" },
|
||||
{ "<leader>Fq", "<cmd>FlutterQuit<cr>", desc = "Quit flutter" },
|
||||
{ "<leader>Fr", "<cmd>FlutterReload<cr>", desc = "Hot reload" },
|
||||
{ "<leader>FR", "<cmd>FlutterRestart<cr>", desc = "Hot restart" },
|
||||
{ "<leader>Fg", "<cmd>FlutterPubGet<cr>", desc = "Pub get" },
|
||||
{ "<leader>Fc", "<cmd>FlutterLogClear<cr>", desc = "Clear logs" },
|
||||
{ "<leader>FF", "<cmd>FlutterRun<cr>", desc = "Flutter run!" },
|
||||
},
|
||||
})
|
||||
|
||||
-- -- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
|
||||
-- -- for people to discover. Otherwise, you normally need to press <C-\><C-n>, which
|
||||
-- -- is not what someone will guess without a bit more experience.
|
||||
-- key.set('t', '<leader><Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })
|
||||
--
|
||||
-- -- TIP: Disable arrow keys in normal mode
|
||||
-- -- vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>')
|
||||
-- -- vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>')
|
||||
-- -- vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>')
|
||||
-- -- vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>')
|
||||
--
|
||||
-- -- Keybinds to make split navigation easier.
|
||||
-- -- Use CTRL+<hjkl> to switch between windows
|
||||
-- -- See `:help wincmd` for a list of all window commands
|
||||
-- vim.keymap.set('n', '<C-h>', '<C-w><C-h>', { desc = 'Move focus to the left window' })
|
||||
-- vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right window' })
|
||||
-- vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
|
||||
-- vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
|
||||
--
|
||||
-- -- NOTE: Some terminals have colliding keymaps or are not able to send distinct keycodes
|
||||
-- -- vim.keymap.set("n", "<C-S-h>", "<C-w>H", { desc = "Move window to the left" })
|
||||
-- -- vim.keymap.set("n", "<C-S-l>", "<C-w>L", { desc = "Move window to the right" })
|
||||
-- -- vim.keymap.set("n", "<C-S-j>", "<C-w>J", { desc = "Move window to the lower" })
|
||||
-- -- vim.keymap.set("n", "<C-S-k>", "<C-w>K", { desc = "Move window to the upper" })
|
||||
--
|
||||
-- end
|
||||
33
nvim/lua/config/lazy.lua
Normal file
33
nvim/lua/config/lazy.lua
Normal file
@ -0,0 +1,33 @@
|
||||
-- Bootstrap lazy.nvim
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require("config.options")
|
||||
|
||||
-- Setup lazy.nvim
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
-- import your plugins
|
||||
{ import = "plugins" },
|
||||
},
|
||||
-- Configure any other settings here. See the documentation for more details.
|
||||
-- colorscheme that will be used when installing plugins.
|
||||
install = { colorscheme = { "tokyionight" } },
|
||||
-- automatically check for plugin updates
|
||||
checker = { enabled = true },
|
||||
})
|
||||
|
||||
require("config.keymaps")
|
||||
115
nvim/lua/config/options.lua
Normal file
115
nvim/lua/config/options.lua
Normal file
@ -0,0 +1,115 @@
|
||||
-- [[ Setting options ]]
|
||||
-- See `:help vim.opt`
|
||||
-- For more options, you can see `:help option-list`
|
||||
local opt = vim.opt
|
||||
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
-- Tabs
|
||||
opt.expandtab = true -- Convert tabs to spaces
|
||||
opt.shiftwidth = 2 -- Amount to indent with << and >>
|
||||
opt.tabstop = 2 -- How many spaces are shown per Tab
|
||||
opt.softtabstop = 2 -- How many spaces are applied when pressing Tab
|
||||
opt.autoindent = true
|
||||
opt.backspace = "indent,eol,start"
|
||||
|
||||
-- Set to true if you have a Nerd Font installed and selected in the terminal
|
||||
vim.g.have_nerd_font = true
|
||||
|
||||
-- Make line numbers default
|
||||
opt.number = true
|
||||
opt.relativenumber = true
|
||||
|
||||
-- Enable mouse mode, can be useful for resizing splits for example!
|
||||
opt.mouse = "a"
|
||||
|
||||
-- Don't show the mode, since it's already in the status line
|
||||
opt.showmode = false
|
||||
|
||||
-- Sync clipboard between OS and Neovim.
|
||||
vim.schedule(function()
|
||||
vim.opt.clipboard = "unnamedplus"
|
||||
end)
|
||||
|
||||
-- Enable break indent
|
||||
opt.breakindent = true
|
||||
|
||||
-- Save undo history
|
||||
opt.undofile = true
|
||||
|
||||
-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term
|
||||
opt.ignorecase = true
|
||||
opt.smartcase = true
|
||||
|
||||
-- Keep signcolumn on by default
|
||||
opt.signcolumn = "yes"
|
||||
|
||||
-- Decrease update time
|
||||
opt.updatetime = 250
|
||||
|
||||
-- Decrease mapped sequence wait time
|
||||
-- opt.timeoutlen = 300
|
||||
|
||||
-- Configure how new splits should be opened
|
||||
opt.splitright = true
|
||||
opt.splitbelow = true
|
||||
|
||||
-- Sets how neovim will display certain whitespace characters in the editor.
|
||||
opt.list = true
|
||||
opt.listchars = { tab = "» ", trail = "·", nbsp = "␣" }
|
||||
|
||||
-- Preview substitutions live, as you type!
|
||||
opt.inccommand = "split"
|
||||
|
||||
-- Show which line your cursor is on
|
||||
opt.cursorline = true
|
||||
|
||||
-- Minimal number of screen lines to keep above and below the cursor.
|
||||
opt.scrolloff = 10
|
||||
|
||||
opt.wrap = true
|
||||
opt.termguicolors = true
|
||||
vim.diagnostic.config({
|
||||
float = { border = "rounded" }, -- add border to diagnostic popups
|
||||
})
|
||||
|
||||
-- Consider - as part of keyword
|
||||
opt.iskeyword:append("-")
|
||||
|
||||
-- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`),
|
||||
-- instead raise a dialog asking if you wish to save the current file(s)
|
||||
-- opt.confirm = true
|
||||
|
||||
-- [[ Basic Autocommands ]]
|
||||
-- See `:help lua-guide-autocommands`
|
||||
|
||||
-- Highlight when yanking (copying) text
|
||||
-- See `:help vim.highlight.on_yank()`
|
||||
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||
desc = "Highlight when yanking (copying) text",
|
||||
group = vim.api.nvim_create_augroup("kickstart-highlight-yank", { clear = true }),
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
})
|
||||
|
||||
-- -- Open directories with oil floating window
|
||||
-- vim.api.nvim_create_autocmd({ "VimEnter" }, {
|
||||
-- pattern = { "*" },
|
||||
-- callback = function()
|
||||
-- args = vim.v.argv
|
||||
-- for i, arg in ipairs(args) do
|
||||
-- print(arg)
|
||||
-- isDirectory = vim.fn.isdirectory(arg)
|
||||
--
|
||||
-- if isDirectory == 1 then
|
||||
-- vim.cmd("bd")
|
||||
-- vim.cmd("Oil --float " .. arg)
|
||||
-- break
|
||||
-- end
|
||||
--
|
||||
-- end
|
||||
--
|
||||
-- end,
|
||||
-- })
|
||||
@ -1,2 +0,0 @@
|
||||
require("enrique.core.options")
|
||||
-- require("enrique.core.keymaps")
|
||||
@ -1,190 +0,0 @@
|
||||
-- This is a function called from the which-key plugin config
|
||||
return function ()
|
||||
local keymap = vim.keymap
|
||||
local wk = require("which-key")
|
||||
-- { "<leader>", "command", desc="decription", mode="n" }, -- single command example
|
||||
|
||||
wk.add({
|
||||
-- Miscellaneous
|
||||
{ "ii", "<ESC>", desc="Exit insert mode with ii", mode="i" },
|
||||
{ "<leader><space>", "<cmd>nohl<cr>", desc="Clear search highlights", mode="n" },
|
||||
{ "<leader>n", "o<esc>", desc="Add new line", mode="n" },
|
||||
{ "<leader>N", "O<esc>", desc="Add new line above", mode="n" },
|
||||
{ "<leader>+", "<C-a>", desc="Increment number by 1", mode="n" },
|
||||
{ "<leader>-", "<C-x>", desc="Decrement number by 1", mode="n" },
|
||||
-- Miscellaneous
|
||||
|
||||
{ -- File saves and exits
|
||||
mode = { "n", "v" },
|
||||
{ "<leader>f", group="Saves and exits" },
|
||||
{ "<leader>fw", "<cmd>w!<cr>", desc = "Save current file"},
|
||||
{"<leader>fW", "<cmd>wa!<cr>", desc = "Save all files"},
|
||||
{"<leader>fq", "<cmd>wq!<cr>", desc = "Save and exit current file"},
|
||||
{"<leader>fQ", "<cmd>wqa!<cr>", desc = "Save and exit all files"},
|
||||
{"<leader>fx", "<cmd>q!<cr>", desc = "Exit file without saving"},
|
||||
{"<leader>fX", "<cmd>q!<cr>", desc = "Exit session without saving"},
|
||||
},
|
||||
|
||||
{ -- Window management
|
||||
mode = {"n"},
|
||||
{ "<leader>w", group="Window management" },
|
||||
{ "<leader>wv", "<C-w>v", desc="Split window vertically" },
|
||||
{ "<leader>wh", "<C-w>s", desc="Split window horizontally" },
|
||||
{ "<leader>we", "<C-w>=", desc="Make splits equal size" },
|
||||
{ "<leader>wx", "<cmd>close<cr>", desc="Close current split" },
|
||||
{ "<leader>wt", "<C-w>+", desc="Make split taller" },
|
||||
{ "<leader>ws", "<C-w>-", desc="Make split shorter" },
|
||||
{ "<leader>wn", "<C-w><", desc="Decrease split width" },
|
||||
{ "<leader>ww", "<C-w>>", desc="Increase split width" },
|
||||
{ "<leader>w<left>", "<C-w><left>", desc="Move to left split" },
|
||||
{ "<leader>w<up>", "<C-w><up>", desc="Move to top split" },
|
||||
{ "<leader>w<down>", "<C-w><down>", desc="Move to bottom split" },
|
||||
{ "<leader>w<right>", "<C-w><right>", desc="Move to right split" },
|
||||
{ "<leader>wm", "<cmd>MaximizerToggle<cr>", desc="Maximize/minimize window" },
|
||||
{ "<leader>wR", "<cmd>SessionRestore<cr>", desc="Restore session" },
|
||||
{ "<leader>wS", "<cmd>SessionSave<cr>", desc="Save session" },
|
||||
},
|
||||
|
||||
{ -- Tab management
|
||||
mode = {"n"},
|
||||
{ "<leader>t", group="Tab management" },
|
||||
{ "<leader>to", "<cmd>tabnew<cr>", desc="Open new tab" },
|
||||
{ "<leader>tx", "<cmd>tabclose<cr>", desc="Close current tab" },
|
||||
{ "<leader>tn", "<cmd>tabn<cr>", desc="Go to next tab" },
|
||||
{ "<leader>tp", "<cmd>tabp<cr>", desc="Go to prev tab" },
|
||||
{ "<leader>tb", "<cmd>tabnew %<cr>", desc="Open currtent buffer in new tab" },
|
||||
},
|
||||
|
||||
{ -- Quickfix
|
||||
mode = {"n"},
|
||||
{ "<leader>q", group="Quickfix" },
|
||||
{ "<leader>qo", "<cmd>copen<cr>", desc="Open quickfix list" },
|
||||
{ "<leader>qf", "<cmd>cfirst<cr>", desc="Jump to first quickfix list item" },
|
||||
{ "<leader>qn", "<cmd>cnext<cr>", desc="Jump to next quickfix list item" },
|
||||
{ "<leader>qp", "<cmd>cprev<cr>", desc="Jump to prev quickfix list item" },
|
||||
{ "<leader>ql", "<cmd>clast<cr>", desc="Jump to last quickfix list item" },
|
||||
{ "<leader>qc", "<cmd>cclose<cr>", desc="Close quickfix list" },
|
||||
},
|
||||
|
||||
{ -- Neotree
|
||||
mode = {"n"},
|
||||
{ "<leader>e", group="File tree" },
|
||||
{ "<leader>ee", "<cmd>Neotree toggle filesystem reveal left<cr>", desc="Toggle file tree" },
|
||||
{ "<leader>ef", "<cmd>Neotree focus<cr>", desc="Focus to file tree" },
|
||||
},
|
||||
|
||||
{ -- Telescope
|
||||
mode = {"n"},
|
||||
{ "<leader>s", group="Search" },
|
||||
{ "<leader>sf", "<cmd>Telescope find_files<cr>", desc="Search files" },
|
||||
{ "<leader>sg", "<cmd>Telescope live_grep<cr>", desc="Search word (livegrep)" },
|
||||
{ "<leader>sb", "<cmd>Telescope buffers<cr>", desc="Search buffers" },
|
||||
{ "<leader>sh", "<cmd>Telescope help_tags<cr>", desc="Search help" },
|
||||
{ "<leader>sk", "<cmd>Telescope keymaps<cr>", desc="Search keymaps" },
|
||||
{ "<leader>sw", "<cmd>Telescope current_buffer_fuzzy_find<cr>", desc="Fuzzy search current buffer" },
|
||||
{ "<leader>ss", "<cmd>Telescope lsp_document_symbols<cr>", desc="Search LSP symbols (current buffer)" },
|
||||
{ "<leader>sp", "<cmd>Telescope builtin<cr>", desc="Select a telescope picker and run it" },
|
||||
{ "<leader>st", function ()
|
||||
require("telescope.builtin").treesitter({ default_text = "" })
|
||||
end, desc="Telescope treesitter" },
|
||||
{ "<leader>C", "<cmd>Telescope colorscheme<cr>", desc="Change colorscheme" },
|
||||
},
|
||||
|
||||
{ -- Language server
|
||||
mode = {"n"},
|
||||
{ "<leader>c", group="LSP & Code actions"},
|
||||
{ "<leader>cc", "<cmd>lua vim.lsp.buf.completion()<cr>", desc="Toggle LSP completion" },
|
||||
{ "<leader>ch", "<cmd>lua vim.lsp.buf.hover()<cr>", desc="Toggle LSP hover (documentation)" },
|
||||
{ "<leader>cd", "<cmd>lua vim.lsp.buf.definition()<cr>", desc="Go to definition" },
|
||||
{ "<leader>cD", "<cmd>lua vim.lsp.buf.declaration()<cr>", desc="Go to declaration" },
|
||||
{ "<leader>ci", "<cmd>Telescope lsp_implementations<cr>", desc="Show LSP implementations" },
|
||||
{ "<leader>ct", "<cmd>Telescope lsp_type_definitions<cr>", desc="Show LSP type definitions" },
|
||||
{ "<leader>cy", "<cmd>AerialToggle<cr>", desc="Toggle aerial symbols list" },
|
||||
{ "<leader>cR", "<cmd>Telescope lsp_references<cr>", desc="List all references of symbol" },
|
||||
{ "<leader>cs", "<cmd>lua vim.lsp.buf.signature_help()<cr>", desc="Display signature info under cursor" },
|
||||
{ "<leader>cr", "<cmd>lua vim.lsp.buf.rename()<cr>", desc="Rename" },
|
||||
{ "<leader>cf", "<cmd>lua vim.lsp.buf.format()<cr>", desc="Format current buffer" },
|
||||
{ "<leader>cl", function () require("lint").try_lint() end, desc="Trigger linting for current buffer" },
|
||||
{ "<leader>ca", "<cmd>lua vim.lsp.buf.code_action()<cr>", desc="Code actions" },
|
||||
{ "<leader>cL", "<cmd>LspRestart<cr>", desc="Restart LSP" },
|
||||
},
|
||||
|
||||
{ -- Diagnostics
|
||||
mode = {"n"},
|
||||
{ "<leader>d", group="Diagnostics" },
|
||||
{ "<leader>dD", "<cmd>Telescope diagnostics bufnr=0<cr>", desc="Show buffer diagnostics" },
|
||||
{ "<leader>dd", "<cmd>lua vim.diagnostic.open_float()<cr>", desc="Show diagnostics in floating window" },
|
||||
{ "<leader>dn", "<cmd>lua vim.diagnostic.goto_next()<cr>", desc="Go to next diagnostic" },
|
||||
{ "<leader>dp", "<cmd>lua vim.diagnostic.goto_prev()<cr>", desc="Go to prev diagnostic" },
|
||||
},
|
||||
|
||||
{ -- Database
|
||||
mode = {"n"},
|
||||
{ "<leader>D", group="Dadbod SQL database"},
|
||||
{ "<leader>Db", "<cmd>DBUIToggle<cr>", desc="Toggle dadbod UI"},
|
||||
{ "<leader>Da", "<cmd>DBUIAddConnection<cr>", desc="Add new database connection"},
|
||||
},
|
||||
|
||||
{ --Bufferline
|
||||
mode = {"n"},
|
||||
{ "<leader>b", group="Buffer" },
|
||||
{ "<leader>bp", "<Cmd>BufferLineTogglePin<CR>", desc = "Toggle Pin" },
|
||||
{ "<leader>bP", "<Cmd>BufferLineGroupClose ungrouped<CR>", desc = "Delete Non-Pinned Buffers" },
|
||||
{ "<leader>bo", "<Cmd>BufferLineCloseOthers<CR>", desc = "Delete Other Buffers" },
|
||||
{ "<leader>br", "<Cmd>BufferLineCloseRight<CR>", desc = "Delete Buffers to the Right" },
|
||||
{ "<leader>bl", "<Cmd>BufferLineCloseLeft<CR>", desc = "Delete Buffers to the Left" },
|
||||
{ "<S-h>", "<cmd>BufferLineCyclePrev<cr>", desc = "Prev Buffer" },
|
||||
{ "<S-l>", "<cmd>BufferLineCycleNext<cr>", desc = "Next Buffer" },
|
||||
{ "<leader>b<left>", "<cmd>BufferLineCyclePrev<cr>", desc = "Prev Buffer" },
|
||||
{ "<leader>b<right>", "<cmd>BufferLineCycleNext<cr>", desc = "Next Buffer" },
|
||||
},
|
||||
|
||||
{ -- TODO comments
|
||||
mode = {"n"},
|
||||
{ "<leader>t", group="TODO" },
|
||||
{ "<leader>tt", "<Cmd>TodoTelescope<CR>", desc = "Show todos" },
|
||||
{ "<leader>tn", function() require("todo-comments").jump_next() end, desc="Next todo comment" },
|
||||
{ "<leader>tp", function() require("todo-comments").jump_prev() end, desc="Previous todo comment" },
|
||||
},
|
||||
|
||||
{ -- Trouble
|
||||
{ "<leader>x", group="Trouble" },
|
||||
{ "<leader>xx", "<cmd>Trouble diagnostics toggle<CR>", desc = "Open/close trouble list" },
|
||||
{ "<leader>xL", "<cmd>Trouble loclist toggle<CR>", desc = "Open trouble location list diagnostics" },
|
||||
{
|
||||
"<leader>xd",
|
||||
"<cmd>Trouble diagnostics toggle filter.buf=0<CR>",
|
||||
desc = "Open trouble document diagnostics",
|
||||
},
|
||||
{ "<leader>xq", "<cmd>Trouble qflist toggle<CR>", desc = "Open trouble quickfix list" },
|
||||
{
|
||||
"<leader>xl",
|
||||
"<cmd>Trouble lsp toggle focus=false win.position=right<CR>",
|
||||
desc = "LSP Definitions / references (Trouble)",
|
||||
},
|
||||
{ "<leader>xt", "<cmd>TodoTrouble<CR>", desc = "Open todos in trouble" },
|
||||
},
|
||||
|
||||
{ -- Flutter
|
||||
mode = {"n"},
|
||||
{ "<leader>F", group="Flutter" },
|
||||
{ "<leader>Ff", "<cmd>Telescope flutter commands<cr>", desc="Show flutter commands" },
|
||||
{ "<leader>Fo", "<cmd>FlutterOutlineToggle<cr>", desc="Show flutter outline" },
|
||||
{ "<leader>Fd", "<cmd>FlutterDevices<cr>", desc="Show devices" },
|
||||
{ "<leader>Fe", "<cmd>FlutterEmulators<cr>", desc="Show emulators" },
|
||||
{ "<leader>Fq", "<cmd>FlutterQuit<cr>", desc="Quit flutter" },
|
||||
{ "<leader>Fr", "<cmd>FlutterReload<cr>", desc="Hot reload" },
|
||||
{ "<leader>FR", "<cmd>FlutterRestart<cr>", desc="Hot restart" },
|
||||
{ "<leader>Fg", "<cmd>FlutterPubGet<cr>", desc="Pub get" },
|
||||
{ "<leader>Fc", "<cmd>FlutterLogClear<cr>", desc="Clear logs" },
|
||||
{ "<leader>FF", "<cmd>FlutterRun<cr>", desc="Flutter run!" },
|
||||
},
|
||||
})
|
||||
-- Substitute
|
||||
local substitute = require("substitute")
|
||||
vim.keymap.set("n", "s", substitute.operator, { desc = "Substitute with motion" })
|
||||
vim.keymap.set("n", "ss", substitute.line, { desc = "Substitute line" })
|
||||
vim.keymap.set("n", "S", substitute.eol, { desc = "Substitute to end of line" })
|
||||
vim.keymap.set("x", "s", substitute.visual, { desc = "Substitute in visual mode" })
|
||||
end
|
||||
|
||||
@ -1,106 +0,0 @@
|
||||
vim.g.mapleader = " "
|
||||
local keymap = vim.keymap
|
||||
|
||||
-- General keymaps
|
||||
-- keymap.set("i", "jk", "<ESC>", { desc = "Exit insert mode eith jk" })
|
||||
-- keymap.set("i", "ii", "<ESC>", { desc = "exit insert mode with ii" })
|
||||
keymap.set("n", "<leader><space>", ":nohl<CR>", { desc = "Clear search highlights" })
|
||||
keymap.set("n", "<leader>n", "o<ESC>", { desc = "Add new line" })
|
||||
keymap.set("n", "<leader>N", "O<ESC>", { desc = "Add new line above" })
|
||||
|
||||
-- File saves and exits
|
||||
-- keymap.set("n", "<leader>wq", ":wq<CR>", { desc = "save and quit" })
|
||||
-- keymap.set("n", "<leader>wqa", ":wqa<CR>", { desc = "save all and quit" })
|
||||
-- keymap.set("n", "<leader>qq", ":q!<CR>", { desc = "quit without saving" })
|
||||
-- keymap.set("n", "<leader>ww", ":w<CR>", { desc = "save" })
|
||||
|
||||
-- increment/decrement numbers
|
||||
keymap.set("n", "<leader>+", "<C-a>", { desc = "Incrment number by 1" })
|
||||
keymap.set("n", "<leader>-", "<C-x>", { desc = "Decrment number by 1" })
|
||||
|
||||
-- Split window management
|
||||
keymap.set("n", "<leader>sv", "<C-w>v", { desc = "Split window vertically" })
|
||||
keymap.set("n", "<leader>sh", "<C-w>s", { desc = "Split window horizontally" })
|
||||
keymap.set("n", "<leader>se", "<C-w>=", { desc = "Make splits equal size" })
|
||||
keymap.set("n", "<leader>sx", "<cmd>close<CR>", { desc = "Close current split" })
|
||||
keymap.set("n", "<A-down>", "<C-w>-", { desc = "make split window height shorter" })
|
||||
keymap.set("n", "<A-up>", "<C-w>+", { desc = "make split windows height taller" })
|
||||
keymap.set("n", "<A-right>", "<C-w>3>", { desc = "make split windows width bigger" })
|
||||
keymap.set("n", "<A-left>", "<C-w>3<", { desc = "make split windows width smaller" })
|
||||
keymap.set("n", "<leader><left>", "<C-w><left>", { desc = "Move to left split" })
|
||||
keymap.set("n", "<leader><right>", "<C-w><right>", { desc = "Move to right split" })
|
||||
keymap.set("n", "<leader><up>", "<C-w><up>", { desc = "Move to top split" })
|
||||
keymap.set("n", "<leader><down>", "<C-w><down>", { desc = "Move to bottom split" })
|
||||
|
||||
-- Tab management
|
||||
keymap.set("n", "<leader>to", "<cmd>tabnew<CR>", { desc = "Open new tab" }) -- open new tab
|
||||
keymap.set("n", "<leader>tx", "<cmd>tabclose<CR>", { desc = "Close current tab" }) -- close current tab
|
||||
keymap.set("n", "<leader>tn", "<cmd>tabn<CR>", { desc = "Go to next tab" }) -- go to next tab
|
||||
keymap.set("n", "<leader>tp", "<cmd>tabp<CR>", { desc = "Go to previous tab" }) -- go to previous tab
|
||||
keymap.set("n", "<leader>tf", "<cmd>tabnew %<CR>", { desc = "Open current buffer in new tab" }) -- move current buffer to new tab
|
||||
keymap.set("n", "<leader>sm", ":MaximizerToggle<CR>", { desc = "toggle maximize tab" })
|
||||
|
||||
-- Diff keymaps
|
||||
keymap.set("n", "<leader>cc", ":diffput<CR>", { desc = "put diff from current to other during diff" })
|
||||
keymap.set("n", "<leader>cj", ":diffget 1<CR>", { desc = "get diff from left (local) during merge" })
|
||||
keymap.set("n", "<leader>ck", ":diffget 3<CR>", { desc = "get diff from right (remote) during merge" })
|
||||
keymap.set("n", "<leader>cn", "]c", { desc = "next diff hunk" })
|
||||
keymap.set("n", "<leader>cp", "[c", { desc = "previous diff hunk" })
|
||||
|
||||
-- Quickfix keymaps
|
||||
keymap.set("n", "<leader>qo", ":copen<CR>", { desc = "open quickfix list" })
|
||||
keymap.set("n", "<leader>qf", ":cfirst<CR>", { desc = "jump to first quickfix list item" })
|
||||
keymap.set("n", "<leader>qn", ":cnext<CR>", { desc = "jump to next quickfix list item" })
|
||||
keymap.set("n", "<leader>qp", ":cprev<CR>", { desc = "jump to prev quickfix list item" })
|
||||
keymap.set("n", "<leader>ql", ":clast<CR>", { desc = "jump to last quickfix list item" })
|
||||
keymap.set("n", "<leader>qc", ":cclose<CR>", { desc = "close quickfix list" })
|
||||
|
||||
-- Nvim-tree
|
||||
keymap.set("n", "<leader>ee", ":NvimTreeToggle<CR>", { desc = "toggle file explorer" })
|
||||
keymap.set("n", "<leader>er", ":NvimTreeFocus<CR>", { desc = "toggle focus to file explorer" })
|
||||
keymap.set("n", "<leader>ef", ":NvimTreeFindFile<CR>", { desc = "find file in file explorer" })
|
||||
|
||||
-- Telescope
|
||||
keymap.set("n", "<leader>ff", "<cmd>Telescope find_files<CR>", { desc = "Find files" })
|
||||
keymap.set("n", "<leader>fg", "<cmd>Telescope live_grep<CR>", { desc = "Live grep" })
|
||||
keymap.set("n", "<leader>fb", "<cmd>Telescope buffers<CR>", { desc = "Find buffers" })
|
||||
keymap.set("n", "<leader>fh", "<cmd>Telescope help_tags<CR>", { desc = "Help tags" })
|
||||
keymap.set("n", "<leader>fs", "<cmd>Telescope current_buffer_fuzzy_find<CR>", { desc = "Fuzzy find current buffer" })
|
||||
keymap.set("n", "<leader>fo", "<cmd>Telescope lsp_document_symbols<CR>", { desc = "Lsp document symbols" })
|
||||
keymap.set("n", "<leader>fi", "<cmd>Telescope lsp_incoming_calls<CR>", { desc = "Lsp incoming calls" })
|
||||
keymap.set("n", "<leader>fm", function()
|
||||
require("telescope.builtin").treesitter({ default_text = "" })
|
||||
end, { desc = "Telescope treesitter" })
|
||||
|
||||
-- LSP
|
||||
keymap.set("n", "<leader>gg", "<cmd>lua vim.lsp.buf.hover()<CR>")
|
||||
keymap.set("n", "<leader>gd", "<cmd>lua vim.lsp.buf.definition()<CR>")
|
||||
keymap.set("n", "<leader>gD", "<cmd>lua vim.lsp.buf.declaration()<CR>")
|
||||
keymap.set("n", "<leader>gi", "<cmd>lua vim.lsp.buf.implementation()<CR>")
|
||||
keymap.set("n", "<leader>gt", "<cmd>lua vim.lsp.buf.type_definition()<CR>")
|
||||
keymap.set("n", "<leader>gr", "<cmd>lua vim.lsp.buf.references()<CR>")
|
||||
keymap.set("n", "<leader>gs", "<cmd>lua vim.lsp.buf.signature_help()<CR>")
|
||||
keymap.set("n", "<leader>rr", "<cmd>lua vim.lsp.buf.rename()<CR>")
|
||||
keymap.set("n", "<leader>gf", "<cmd>lua vim.lsp.buf.format({async = true})<CR>")
|
||||
keymap.set("v", "<leader>gf", "<cmd>lua vim.lsp.buf.format({async = true})<CR>")
|
||||
keymap.set("n", "<leader>ga", "<cmd>lua vim.lsp.buf.code_action()<CR>")
|
||||
keymap.set("n", "<leader>gl", "<cmd>lua vim.diagnostic.open_float()<CR>")
|
||||
keymap.set("n", "<leader>gp", "<cmd>lua vim.diagnostic.goto_prev()<CR>")
|
||||
keymap.set("n", "<leader>gn", "<cmd>lua vim.diagnostic.goto_next()<CR>")
|
||||
keymap.set("n", "<leader>tr", "<cmd>lua vim.lsp.buf.document_symbol()<CR>")
|
||||
keymap.set("i", "<C-Space>", "<cmd>lua vim.lsp.buf.completion()<CR>")
|
||||
|
||||
-- Database
|
||||
keymap.set("n", "<leader>db", function()
|
||||
vim.cmd("tabnew")
|
||||
vim.cmd("DBUIToggle")
|
||||
end, { desc = "Open dadbod in new tab" })
|
||||
keymap.set("n", "<leader>dt", function()
|
||||
vim.cmd("DBUIToggle")
|
||||
end, { desc = "Toggle dabase ui" })
|
||||
keymap.set("n", "<leader>da", function()
|
||||
vim.cmd("DBUIAddConnection")
|
||||
end, { desc = "Add new database connection" })
|
||||
|
||||
-- Aerial
|
||||
keymap.set("n", "<leader>a", "<cmd>AerialToggle!<CR>", { desc = "Toggle aerial (symbols)" })
|
||||
@ -1,49 +0,0 @@
|
||||
vim.cmd("let g:netrw_liststyle = 3")
|
||||
local opt = vim.opt
|
||||
vim.g.mapleader = " "
|
||||
-- Session Management
|
||||
opt.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions"
|
||||
vim.api.nvim_set_keymap('i', '<C-x><C-z>', '<cmd>lua print(vim.inspect(require("cmp").config.window))<CR>', {noremap = true, silent = true})
|
||||
-- line nuembers
|
||||
opt.relativenumber = true
|
||||
opt.number = true
|
||||
|
||||
-- tabs & indentation
|
||||
opt.tabstop = 2
|
||||
opt.shiftwidth = 2
|
||||
opt.softtabstop = 2
|
||||
opt.expandtab = true
|
||||
opt.autoindent = true
|
||||
|
||||
-- search settings
|
||||
opt.ignorecase = true
|
||||
opt.smartcase = true
|
||||
|
||||
-- backspace
|
||||
opt.backspace = "indent,eol,start"
|
||||
|
||||
--clipborad
|
||||
opt.clipboard:append("unnamedplus")
|
||||
|
||||
-- split windows
|
||||
opt.splitright = true
|
||||
opt.splitbelow = true
|
||||
|
||||
-- other settings
|
||||
opt.wrap = true
|
||||
opt.cursorline = true
|
||||
opt.termguicolors = true
|
||||
opt.signcolumn = "yes"
|
||||
opt.scrolloff = 10
|
||||
vim.diagnostic.config({
|
||||
float = { border = "rounded" }, -- add border to diagnostic popups
|
||||
})
|
||||
-- opt.background = "dark"
|
||||
|
||||
-- Consider - as part of keyword
|
||||
opt.iskeyword:append("-")
|
||||
|
||||
-- Folding
|
||||
opt.foldlevel = 25
|
||||
-- opt.foldmethod = "expr"
|
||||
-- opt.foldexpr = "nvim_treesitter#foldexpr()" -- Utilize Treesitter folds
|
||||
@ -1,22 +0,0 @@
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable", -- latest stable release
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require("lazy").setup({ { import = "enrique.plugins" }, { import = "enrique.plugins.lsp" } }, {
|
||||
checker = {
|
||||
enabled = true,
|
||||
notify = false,
|
||||
},
|
||||
change_detection = {
|
||||
notify = false,
|
||||
},
|
||||
})
|
||||
@ -1,62 +0,0 @@
|
||||
return {
|
||||
'stevearc/aerial.nvim',
|
||||
opts = function ()
|
||||
require("aerial").setup({
|
||||
-- optionally use on_attach to set keymaps when aerial has attached to a buffer
|
||||
on_attach = function(bufnr)
|
||||
-- Jump forwards/backwards with '{' and '}'
|
||||
vim.keymap.set("n", "{", "<cmd>AerialPrev<CR>", { buffer = bufnr })
|
||||
vim.keymap.set("n", "}", "<cmd>AerialNext<CR>", { buffer = bufnr })
|
||||
end,
|
||||
max_width = { 40, 0.2 },
|
||||
backends = { "treesitter", "lsp" },
|
||||
default_direction = "float",
|
||||
float = {
|
||||
border = "rounded",
|
||||
|
||||
-- Determines location of floating window
|
||||
-- cursor - Opens float on top of the cursor
|
||||
-- editor - Opens float centered in the editor
|
||||
-- win - Opens float centered in the window
|
||||
relative = "cursor",
|
||||
|
||||
-- These control the height of the floating window.
|
||||
-- They can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
|
||||
-- min_height and max_height can be a list of mixed types.
|
||||
-- min_height = {8, 0.1} means "the greater of 8 rows or 10% of total"
|
||||
max_height = 0.9,
|
||||
height = nil,
|
||||
min_height = { 8, 0.1 },
|
||||
|
||||
override = function(conf, source_winid)
|
||||
-- This is the config that will be passed to nvim_open_win.
|
||||
-- Change values here to customize the layout
|
||||
return conf
|
||||
end,
|
||||
},
|
||||
})
|
||||
-- You probably also want to set a keymap to toggle aerial
|
||||
|
||||
-- require("telescope").setup({
|
||||
-- extensions = {
|
||||
-- aerial = {
|
||||
-- -- How to format the symbols
|
||||
-- format_symbol = function(symbol_path, filetype)
|
||||
-- if filetype == "json" or filetype == "yaml" then
|
||||
-- return table.concat(symbol_path, ".")
|
||||
-- else
|
||||
-- return symbol_path[#symbol_path]
|
||||
-- end
|
||||
-- end,
|
||||
-- -- Available modes: symbols, lines, both
|
||||
-- show_columns = "both",
|
||||
-- },
|
||||
-- },
|
||||
-- })
|
||||
end,
|
||||
-- Optional dependencies
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"nvim-tree/nvim-web-devicons"
|
||||
},
|
||||
}
|
||||
@ -1,36 +0,0 @@
|
||||
return {
|
||||
"goolord/alpha-nvim",
|
||||
event = "VimEnter",
|
||||
config = function()
|
||||
local alpha = require("alpha")
|
||||
local dashboard = require("alpha.themes.dashboard")
|
||||
|
||||
-- Set header
|
||||
dashboard.section.header.val = {
|
||||
" ",
|
||||
" ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ",
|
||||
" ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ",
|
||||
" ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ",
|
||||
" ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ",
|
||||
" ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ",
|
||||
" ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ",
|
||||
" ",
|
||||
}
|
||||
|
||||
-- Set menu
|
||||
dashboard.section.buttons.val = {
|
||||
dashboard.button("SPC ee", " > Toggle file explorer", ":Neotree toggle filesystem reveal left<CR>"),
|
||||
dashboard.button("SPC ff", " > Find File", "<cmd>Telescope find_files<CR>"),
|
||||
dashboard.button("e", " > New File", "<cmd>ene<CR>"),
|
||||
dashboard.button("SPC fs", " > Find Word", "<cmd>Telescope live_grep<CR>"),
|
||||
dashboard.button("SPC wr", " > Restore Session For Current Directory", "<cmd>SessionRestore<CR>"),
|
||||
dashboard.button("q", " > Quit NVIM", "<cmd>qa<CR>"),
|
||||
}
|
||||
|
||||
-- Send config to alpha
|
||||
alpha.setup(dashboard.opts)
|
||||
|
||||
-- Disable folding on alpha buffer
|
||||
vim.cmd([[autocmd FileType alpha setlocal nofoldenable]])
|
||||
end,
|
||||
}
|
||||
@ -1,16 +0,0 @@
|
||||
return {
|
||||
"rmagatti/auto-session",
|
||||
config = function()
|
||||
local auto_session = require("auto-session")
|
||||
|
||||
auto_session.setup({
|
||||
auto_restore_enabled = false,
|
||||
auto_session_suppress_dirs = { "~/", "~/Dev/", "~/Downloads", "~/Documents", "~/Desktop/" },
|
||||
})
|
||||
|
||||
local keymap = vim.keymap
|
||||
|
||||
keymap.set("n", "<leader>wr", "<cmd>SessionRestore<CR>", { desc = "Restore session for" })
|
||||
keymap.set("n", "<leader>ws", "<cmd>SessionSave<CR>", { desc = "Save session for auto session" })
|
||||
end,
|
||||
}
|
||||
@ -1,30 +0,0 @@
|
||||
return {
|
||||
"windwp/nvim-autopairs",
|
||||
event = { "InsertEnter" },
|
||||
dependencies = {
|
||||
"hrsh7th/nvim-cmp",
|
||||
},
|
||||
config = function()
|
||||
-- import nvim-autopairs
|
||||
local autopairs = require("nvim-autopairs")
|
||||
|
||||
-- configure autopairs
|
||||
autopairs.setup({
|
||||
check_ts = true, -- enable treesitter
|
||||
ts_config = {
|
||||
lua = { "string" }, -- don't add pairs in lua string treesitter nodes
|
||||
javascript = { "template_string" }, -- don't add pairs in javscript template_string treesitter nodes
|
||||
java = false, -- don't check treesitter on java
|
||||
},
|
||||
})
|
||||
|
||||
-- import nvim-autopairs completion functionality
|
||||
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||
|
||||
-- import nvim-cmp plugin (completions plugin)
|
||||
local cmp = require("cmp")
|
||||
|
||||
-- make autopairs and completion work together
|
||||
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||
end,
|
||||
}
|
||||
@ -1,31 +0,0 @@
|
||||
-- Display LSP-based breadcrumbs
|
||||
return {
|
||||
-- https://github.com/utilyre/barbecue.nvim
|
||||
"utilyre/barbecue.nvim",
|
||||
name = "barbecue",
|
||||
version = "*",
|
||||
dependencies = {
|
||||
-- https://github.com/SmiteshP/nvim-navic
|
||||
"SmiteshP/nvim-navic",
|
||||
-- https://github.com/nvim-tree/nvim-web-devicons
|
||||
"nvim-tree/nvim-web-devicons", -- optional dependency
|
||||
},
|
||||
opts = {
|
||||
---@type boolean
|
||||
show_dirname = false,
|
||||
---@type boolean
|
||||
show_basename = false,
|
||||
|
||||
symbols = {
|
||||
---Modification indicator.
|
||||
---@type string
|
||||
modified = "●",
|
||||
---Truncation indicator.
|
||||
---@type string
|
||||
ellipsis = "…",
|
||||
---Entry separator.
|
||||
---@type string
|
||||
separator = "",
|
||||
},
|
||||
},
|
||||
}
|
||||
@ -1,12 +0,0 @@
|
||||
-- Improve performance of editing big files
|
||||
return {
|
||||
-- https://github.com/LunarVim/bigfile.nvim
|
||||
"LunarVim/bigfile.nvim",
|
||||
event = "BufReadPre",
|
||||
opts = {
|
||||
filesize = 2, -- size of the file in MiB, the plugin round file sizes to the closest MiB
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("bigfile").setup(opts)
|
||||
end,
|
||||
}
|
||||
@ -1,28 +0,0 @@
|
||||
return {
|
||||
"akinsho/bufferline.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
options = {
|
||||
offsets = {
|
||||
{
|
||||
filetype = "neo-tree",
|
||||
text = "Neo-tree",
|
||||
highlight = "Directory",
|
||||
text_align = "left",
|
||||
},
|
||||
},
|
||||
indicator = { icon = " ", style = "icon" },
|
||||
},
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("bufferline").setup(opts)
|
||||
-- Fix bufferline when restoring a session
|
||||
vim.api.nvim_create_autocmd({ "BufAdd", "BufDelete" }, {
|
||||
callback = function()
|
||||
vim.schedule(function()
|
||||
pcall(nvim_bufferline)
|
||||
end)
|
||||
end,
|
||||
})
|
||||
end,
|
||||
}
|
||||
@ -1,53 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"binhtran432k/dracula.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
opts = {},
|
||||
config = function()
|
||||
require("dracula").setup({
|
||||
style = "default", -- The theme comes in three styles, `default`, a darker variant `soft` and `day`
|
||||
transparent = true, -- Enable this to disable setting the background color
|
||||
terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim
|
||||
styles = {
|
||||
variables = {},
|
||||
-- Background styles. Can be "dark", "transparent" or "normal"
|
||||
sidebars = "transparent", -- style for sidebars, see below
|
||||
floats = "normal", -- style for floating windows
|
||||
},
|
||||
dim_inactive = false, -- dims inactive windows
|
||||
lualine_bold = false, -- When `true`, section headers in the lualine theme will be bold
|
||||
|
||||
})
|
||||
-- vim.cmd[[colorscheme dracula]]
|
||||
end
|
||||
},
|
||||
|
||||
{
|
||||
-- Tokio Night
|
||||
"folke/tokyonight.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
opts = {},
|
||||
config = function()
|
||||
require ("tokyonight").setup({
|
||||
syle = "storm", -- storm, moon, night, day
|
||||
light_style = "day",
|
||||
transparent = true,
|
||||
terminal_colors = true,
|
||||
-- Background styles. Can be "dark", "transparent" or "normal"
|
||||
styles = {
|
||||
sidebars = "transparent",
|
||||
floats = "normal",
|
||||
},
|
||||
day_brightness = 0.9, -- Adjusts the brightness of the **Day** style
|
||||
dim_inactive = false, -- dims inactive windows
|
||||
lualine_bold = true, -- Lualine theme will be bold
|
||||
})
|
||||
vim.cmd[[
|
||||
colorscheme tokyonight
|
||||
hi CocUnusedHighlight cterm=underline gui=underline
|
||||
]]
|
||||
end
|
||||
}
|
||||
}
|
||||
@ -1,19 +0,0 @@
|
||||
return {
|
||||
"numToStr/Comment.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = {
|
||||
"JoosepAlviste/nvim-ts-context-commentstring",
|
||||
},
|
||||
config = function()
|
||||
-- import comment plugin safely
|
||||
local comment = require("Comment")
|
||||
|
||||
local ts_context_commentstring = require("ts_context_commentstring.integrations.comment_nvim")
|
||||
|
||||
-- enable comment
|
||||
comment.setup({
|
||||
-- for commenting tsx, jsx, svelte, html files
|
||||
pre_hook = ts_context_commentstring.create_pre_hook(),
|
||||
})
|
||||
end,
|
||||
}
|
||||
@ -1,13 +0,0 @@
|
||||
return {
|
||||
"kristijanhusak/vim-dadbod-ui",
|
||||
dependencies = {
|
||||
{ "tpope/vim-dadbod" },
|
||||
{ "kristijanhusak/vim-dadbod-completion", ft = { "sql", "mysql", "plsql" } },
|
||||
},
|
||||
cmd = {
|
||||
"DBUI",
|
||||
"DBUIToggle",
|
||||
"DBUIAddConnection",
|
||||
"DBUIFindBuffer",
|
||||
},
|
||||
}
|
||||
@ -1,4 +0,0 @@
|
||||
return {
|
||||
"stevearc/dressing.nvim",
|
||||
event = "VeryLazy",
|
||||
}
|
||||
@ -1,32 +0,0 @@
|
||||
return {
|
||||
'akinsho/flutter-tools.nvim',
|
||||
lazy = false,
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'stevearc/dressing.nvim', -- optional for vim.ui.select
|
||||
},
|
||||
config = function ()
|
||||
require("flutter-tools").setup {
|
||||
ui = {
|
||||
border = "shadow",
|
||||
},
|
||||
decorations = {
|
||||
statusline = {
|
||||
device = true,
|
||||
},
|
||||
},
|
||||
closing_tags = {
|
||||
prefix = "••• ",
|
||||
enabled = true,
|
||||
},
|
||||
lsp = {
|
||||
color = {
|
||||
enabled = true,
|
||||
background = true,
|
||||
virtual_text = true,
|
||||
virtual_text_str = ""
|
||||
},
|
||||
},
|
||||
}
|
||||
end
|
||||
}
|
||||
@ -1,4 +0,0 @@
|
||||
return {
|
||||
'nmac427/guess-indent.nvim',
|
||||
config = function() require('guess-indent').setup {} end,
|
||||
}
|
||||
@ -1,4 +0,0 @@
|
||||
return {
|
||||
"RRethy/vim-illuminate",
|
||||
config = function(_, opts) require("illuminate").configure(opts) end,
|
||||
}
|
||||
@ -1,8 +0,0 @@
|
||||
return {
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
main = "ibl",
|
||||
opts = {
|
||||
indent = { char = "┊" },
|
||||
},
|
||||
}
|
||||
@ -1,4 +0,0 @@
|
||||
return {
|
||||
"nvim-lua/plenary.nvim", -- lua functions that many plugins use
|
||||
"christoomey/vim-tmux-navigator", -- tmux & split window navigation
|
||||
}
|
||||
@ -1,25 +0,0 @@
|
||||
return {
|
||||
"mfussenegger/nvim-lint",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = function()
|
||||
local lint = require("lint")
|
||||
|
||||
lint.linters_by_ft = {
|
||||
javascript = { "eslint_d" },
|
||||
typescript = { "eslint_d" },
|
||||
javascriptreact = { "eslint_d" },
|
||||
typescriptreact = { "eslint_d" },
|
||||
svelte = { "eslint_d" },
|
||||
-- python = { "pylint" },
|
||||
}
|
||||
|
||||
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
||||
group = lint_augroup,
|
||||
callback = function()
|
||||
lint.try_lint()
|
||||
end,
|
||||
})
|
||||
end,
|
||||
}
|
||||
@ -1,124 +0,0 @@
|
||||
return {
|
||||
"neovim/nvim-lspconfig",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
{ "antosha417/nvim-lsp-file-operations", config = true },
|
||||
{ "folke/neodev.nvim", opts = {} },
|
||||
{ "j-hui/fidget.nvim", tag = "legacy" },
|
||||
"RobertBrunhage/dart-tools.nvim",
|
||||
},
|
||||
config = function()
|
||||
local lspconfig = require("lspconfig")
|
||||
local mason_lspconfig = require("mason-lspconfig")
|
||||
local cmp_nvim_lsp = require("cmp_nvim_lsp")
|
||||
|
||||
local keymap = vim.keymap -- for conciseness
|
||||
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = vim.api.nvim_create_augroup("UserLspConfig", {}),
|
||||
callback = function(ev)
|
||||
-- Buffer local mappings.
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
local opts = { buffer = ev.buf, silent = true }
|
||||
|
||||
-- set keybinds
|
||||
opts.desc = "Go to declaration"
|
||||
keymap.set("n", "gD", "<cmd>vim.lsp.buf.declaration()<cr>", opts) -- go to declaration
|
||||
|
||||
opts.desc = "Show LSP definitions"
|
||||
keymap.set("n", "gd", "<cmd>Telescope lsp_definitions<CR>", opts) -- show lsp definitions
|
||||
|
||||
opts.desc = "Smart rename"
|
||||
keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts) -- smart rename
|
||||
|
||||
end,
|
||||
})
|
||||
|
||||
-- used to enable autocompletion (assign to every lsp server config)
|
||||
local capabilities = cmp_nvim_lsp.default_capabilities()
|
||||
|
||||
-- Change the Diagnostic symbols in the sign column (gutter)
|
||||
local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " }
|
||||
for type, icon in pairs(signs) do
|
||||
local hl = "DiagnosticSign" .. type
|
||||
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
|
||||
end
|
||||
|
||||
mason_lspconfig.setup_handlers({
|
||||
-- default handler for installed servers
|
||||
function(server_name)
|
||||
lspconfig[server_name].setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
end,
|
||||
|
||||
["lua_ls"] = function()
|
||||
-- configure lua server (with special settings)
|
||||
lspconfig["lua_ls"].setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
-- make the language server recognize "vim" global
|
||||
diagnostics = {
|
||||
globals = { "vim" },
|
||||
},
|
||||
completion = {
|
||||
callSnippet = "Replace",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
||||
-- lspconfig["dcmls"].setup({
|
||||
-- capabilities = capabilities,
|
||||
-- cmd = {
|
||||
-- "dcm",
|
||||
-- "start-server",
|
||||
-- },
|
||||
-- filetypes = { "dart", "yaml" },
|
||||
-- })
|
||||
|
||||
-- lspconfig["dartls"].setup({
|
||||
-- capabilities = capabilities,
|
||||
-- cmd = {
|
||||
-- "dart",
|
||||
-- "language-server",
|
||||
-- "--protocol=lsp",
|
||||
-- -- "--port=8123",
|
||||
-- -- "--instrumentation-log-file=/Users/robertbrunhage/Desktop/lsp-log.txt",
|
||||
-- },
|
||||
-- filetypes = { "dart" },
|
||||
-- init_options = {
|
||||
-- onlyAnalyzeProjectsWithOpenFiles = false,
|
||||
-- suggestFromUnimportedLibraries = true,
|
||||
-- closingLabels = true,
|
||||
-- outline = false,
|
||||
-- flutterOutline = false,
|
||||
-- },
|
||||
-- settings = {
|
||||
-- dart = {
|
||||
-- updateImportsOnRename = true,
|
||||
-- completeFunctionCalls = true,
|
||||
-- showTodos = true,
|
||||
-- },
|
||||
-- },
|
||||
-- })
|
||||
|
||||
-- Tooltip for the lsp in bottom right
|
||||
require("fidget").setup({})
|
||||
|
||||
-- Hot reload :)
|
||||
require("dart-tools")
|
||||
|
||||
-- Globally configure all LSP floating preview popups (like hover, signature help, etc)
|
||||
local open_floating_preview = vim.lsp.util.open_floating_preview
|
||||
function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...)
|
||||
opts = opts or {}
|
||||
opts.border = opts.border or "rounded"-- Set border to rounded
|
||||
return open_floating_preview(contents, syntax, opts, ...)
|
||||
end
|
||||
end,
|
||||
}
|
||||
@ -1,76 +0,0 @@
|
||||
-- LSP Support
|
||||
return {
|
||||
-- LSP Configuration
|
||||
-- https://github.com/neovim/nvim-lspconfig
|
||||
"neovim/nvim-lspconfig",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
-- LSP Management
|
||||
-- https://github.com/williamboman/mason.nvim
|
||||
{ "williamboman/mason.nvim" },
|
||||
-- https://github.com/williamboman/mason-lspconfig.nvim
|
||||
{ "williamboman/mason-lspconfig.nvim" },
|
||||
|
||||
-- Useful status updates for LSP
|
||||
-- https://github.com/j-hui/fidget.nvim
|
||||
{ "j-hui/fidget.nvim", opts = {} },
|
||||
|
||||
-- Additional lua configuration, makes nvim stuff amazing!
|
||||
-- https://github.com/folke/neodev.nvim
|
||||
{ "folke/neodev.nvim" },
|
||||
},
|
||||
config = function()
|
||||
require("mason").setup()
|
||||
require("mason-lspconfig").setup({
|
||||
-- Install these LSPs automatically
|
||||
ensure_installed = {
|
||||
-- 'bashls', -- requires npm to be installed
|
||||
-- 'cssls', -- requires npm to be installed
|
||||
-- 'html', -- requires npm to be installed
|
||||
"lua_ls",
|
||||
-- 'jsonls', -- requires npm to be installed
|
||||
"lemminx",
|
||||
"marksman",
|
||||
"quick_lint_js",
|
||||
-- 'tsserver', -- requires npm to be installed
|
||||
-- 'yamlls', -- requires npm to be installed
|
||||
},
|
||||
})
|
||||
|
||||
local lspconfig = require("lspconfig")
|
||||
local lsp_capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
local lsp_attach = function(client, bufnr)
|
||||
-- Create your keybindings here...
|
||||
end
|
||||
|
||||
-- Call setup on each LSP server
|
||||
require("mason-lspconfig").setup_handlers({
|
||||
function(server_name)
|
||||
lspconfig[server_name].setup({
|
||||
on_attach = lsp_attach,
|
||||
capabilities = lsp_capabilities,
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
||||
-- Lua LSP settings
|
||||
lspconfig.lua_ls.setup({
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global
|
||||
globals = { "vim" },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Globally configure all LSP floating preview popups (like hover, signature help, etc)
|
||||
local open_floating_preview = vim.lsp.util.open_floating_preview
|
||||
function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...)
|
||||
opts = opts or {}
|
||||
opts.border = opts.border or "rounded" -- Set border to rounded
|
||||
return open_floating_preview(contents, syntax, opts, ...)
|
||||
end
|
||||
end,
|
||||
}
|
||||
@ -1,46 +0,0 @@
|
||||
return {
|
||||
"williamboman/mason.nvim",
|
||||
dependencies = {
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
"WhoIsSethDaniel/mason-tool-installer.nvim",
|
||||
},
|
||||
config = function()
|
||||
local mason = require("mason")
|
||||
local mason_lspconfig = require("mason-lspconfig")
|
||||
local mason_tool_installer = require("mason-tool-installer")
|
||||
-- enable mason and configure icons
|
||||
mason.setup({
|
||||
ui = {
|
||||
icons = {
|
||||
package_installed = "✓",
|
||||
package_pending = "➜",
|
||||
package_uninstalled = "✗",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
mason_lspconfig.setup({
|
||||
-- list of servers for mason to install
|
||||
ensure_installed = {
|
||||
"html",
|
||||
"tailwindcss",
|
||||
"lua_ls",
|
||||
"pyright",
|
||||
"sqlls",
|
||||
"bashls",
|
||||
"taplo",
|
||||
},
|
||||
})
|
||||
mason_tool_installer.setup({
|
||||
ensure_installed = {
|
||||
"prettier", -- prettier formatter
|
||||
"stylua", -- lua formatter
|
||||
"isort", -- python formatter
|
||||
"black", -- python formatter
|
||||
"sql-formatter",
|
||||
--"pylint", -- python linter
|
||||
"eslint_d", -- js linter
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
@ -1,59 +0,0 @@
|
||||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
config = function()
|
||||
local lualine = require("lualine")
|
||||
local lazy_status = require("lazy.status") -- to configure lazy pending updates count
|
||||
|
||||
lualine.setup({
|
||||
options = {
|
||||
theme = "dracula",
|
||||
},
|
||||
sections = {
|
||||
lualine_x = {
|
||||
-- {
|
||||
-- require("noice").api.status.message.get_hl,
|
||||
-- cond = require("noice").api.status.message.has,
|
||||
-- },
|
||||
{
|
||||
require("noice").api.status.command.get,
|
||||
cond = require("noice").api.status.command.has,
|
||||
color = { fg = "#ff9e64" },
|
||||
},
|
||||
{
|
||||
require("noice").api.status.mode.get,
|
||||
cond = require("noice").api.status.mode.has,
|
||||
color = { fg = "#ff9e64" },
|
||||
},
|
||||
{
|
||||
require("noice").api.status.search.get,
|
||||
cond = require("noice").api.status.search.has,
|
||||
color = { fg = "#ff9e64" },
|
||||
},
|
||||
{
|
||||
lazy_status.updates,
|
||||
cond = lazy_status.has_updates,
|
||||
color = { fg = "#ff9e64" },
|
||||
},
|
||||
},
|
||||
lualine_c = {
|
||||
{
|
||||
-- Customize the filename part of lualine to be parent/filename
|
||||
"filename",
|
||||
file_status = true, -- Displays file status (readonly status, modified status)
|
||||
newfile_status = false, -- Display new file status (new file means no write after created)
|
||||
path = 4, -- 0: Just the filename
|
||||
-- 1: Relative path
|
||||
-- 2: Absolute path
|
||||
-- 3: Absolute path, with tilde as the home directory
|
||||
-- 4: Filename and parent dir, with tilde as the home directory
|
||||
symbols = {
|
||||
modified = "[+]", -- Text to show when the file is modified.
|
||||
readonly = "[-]", -- Text to show when the file is non-modifiable or readonly.
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
@ -1,4 +0,0 @@
|
||||
return {
|
||||
'echasnovski/mini.icons',
|
||||
version = false
|
||||
}
|
||||
@ -1,24 +0,0 @@
|
||||
return {
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
|
||||
"MunifTanjim/nui.nvim",
|
||||
-- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information
|
||||
},
|
||||
config = function()
|
||||
require("neo-tree").setup({
|
||||
filesystem = {
|
||||
filtered_items = {
|
||||
visible = true, -- This is what you want: If you set this to `true`, all "hide" just mean "dimmed out"
|
||||
hide_dotfiles = false,
|
||||
hide_gitignored = true,
|
||||
},
|
||||
},
|
||||
window = {
|
||||
position = "right",
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
@ -1,36 +0,0 @@
|
||||
-- lazy.nvim
|
||||
return {
|
||||
"folke/noice.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
-- add any options here
|
||||
},
|
||||
dependencies = {
|
||||
-- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
|
||||
"MunifTanjim/nui.nvim",
|
||||
-- OPTIONAL:
|
||||
-- `nvim-notify` is only needed, if you want to use the notification view.
|
||||
-- If not available, we use `mini` as the fallback
|
||||
"rcarriga/nvim-notify",
|
||||
},
|
||||
config = function()
|
||||
require("noice").setup({
|
||||
lsp = {
|
||||
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
|
||||
override = {
|
||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||
["vim.lsp.util.stylize_markdown"] = true,
|
||||
["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp
|
||||
},
|
||||
},
|
||||
-- you can enable a preset for easier configuration
|
||||
presets = {
|
||||
bottom_search = true, -- use a classic bottom cmdline for search
|
||||
command_palette = true, -- position the cmdline and popupmenu together
|
||||
long_message_to_split = true, -- long messages will be sent to a split
|
||||
inc_rename = false, -- enables an input dialog for inc-rename.nvim
|
||||
lsp_doc_border = true, -- add a border to hover docs and signature help
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
@ -1,147 +0,0 @@
|
||||
-- Auto-completion / Snippets
|
||||
return {
|
||||
-- https://github.com/hrsh7th/nvim-cmp
|
||||
"hrsh7th/nvim-cmp",
|
||||
event = "InsertEnter",
|
||||
dependencies = {
|
||||
-- Snippet engine & associated nvim-cmp source
|
||||
-- https://github.com/L3MON4D3/LuaSnip
|
||||
"L3MON4D3/LuaSnip",
|
||||
-- https://github.com/saadparwaiz1/cmp_luasnip
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
|
||||
-- LSP completion capabilities
|
||||
-- https://github.com/hrsh7th/cmp-nvim-lsp
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
|
||||
-- Additional user-friendly snippets
|
||||
-- https://github.com/rafamadriz/friendly-snippets
|
||||
"rafamadriz/friendly-snippets",
|
||||
-- https://github.com/hrsh7th/cmp-buffer
|
||||
"hrsh7th/cmp-buffer",
|
||||
-- https://github.com/hrsh7th/cmp-path
|
||||
"hrsh7th/cmp-path",
|
||||
-- https://github.com/hrsh7th/cmp-cmdline
|
||||
"hrsh7th/cmp-cmdline",
|
||||
-- sql completion
|
||||
"kristijanhusak/vim-dadbod-completion",
|
||||
{"onsails/lspkind.nvim", lazy = true},
|
||||
},
|
||||
config = function()
|
||||
local cmp = require("cmp")
|
||||
local luasnip = require("luasnip")
|
||||
local lspkind = require('lspkind')
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
luasnip.config.setup({})
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
completion = {
|
||||
completeopt = "menu,menuone,noinsert",
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-j>"] = cmp.mapping.select_next_item(), -- next suggestion
|
||||
["<C-k>"] = cmp.mapping.select_prev_item(), -- previous suggestion
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-4), -- scroll backward
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4), -- scroll forward
|
||||
["<C-Space>"] = cmp.mapping.complete({}), -- show completion suggestions
|
||||
["<A-CR>"] = cmp.mapping.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
}),
|
||||
-- Tab through suggestions or when a snippet is active, tab to the next argument
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
-- cmp.select_next_item()
|
||||
cmp.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
})
|
||||
elseif luasnip.expand_or_locally_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
-- Tab backwards through suggestions or when a snippet is active, tab to the next argument
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.locally_jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "vim-dadbod-completion" }, -- sql
|
||||
{ name = "nvim_lsp" }, -- lsp
|
||||
{ name = "luasnip" }, -- snippets
|
||||
{ name = "buffer" }, -- text within current buffer
|
||||
{ name = "path" }, -- file system paths
|
||||
}),
|
||||
window = {
|
||||
completion = {
|
||||
width = 23,
|
||||
max_height = 13,
|
||||
border = "rounded",
|
||||
winhighlight = "Normal:CmpPmenu,CursorLine:PmenuSel,Search:None",
|
||||
-- winhighlight = "Normal:CmpPmenu,FloatBorder:CmpPmenuBorder,CursorLine:PmenuSel,Search:None",
|
||||
},
|
||||
documentation = {
|
||||
max_width = 72,
|
||||
max_height = 23,
|
||||
border = "rounded",
|
||||
winhighlight = "Normal:CmpDoc",
|
||||
},
|
||||
},
|
||||
formatting = {
|
||||
fields = { "kind", "abbr", "menu" },
|
||||
format = function(entry, vim_item)
|
||||
local kind = require("lspkind").cmp_format({
|
||||
mode = "symbol_text",
|
||||
maxwidth = 42,
|
||||
ellipsis_char = "··",
|
||||
-- show_labelDetails = true,
|
||||
menu = ({
|
||||
buffer = "Bfr",
|
||||
nvim_lsp = "LSP",
|
||||
luasnip = "Snp",
|
||||
nvim_lua = "Lua",
|
||||
latex_symbols = "Ltx",
|
||||
})
|
||||
})(entry, vim_item)
|
||||
local strings = vim.split(kind.kind, "%s", { trimempty = true })
|
||||
local men = kind.menu
|
||||
kind.kind = (strings[1] or "") .. " "
|
||||
kind.menu = (men or "") .. " | " .. (strings[2] or "")
|
||||
|
||||
return kind
|
||||
end,
|
||||
},
|
||||
-- formatting = {
|
||||
-- format = lspkind.cmp_format({
|
||||
-- mode = "symbol_text", -- text_symbol or symbol_text
|
||||
-- maxwidth = 23,
|
||||
-- ellipsis_char = '..',
|
||||
-- show_labelDetails = true,
|
||||
-- menu = ({
|
||||
-- buffer = "[Buffer]",
|
||||
-- nvim_lsp = "[LSP]",
|
||||
-- luasnip = "[LuaSnip]",
|
||||
-- nvim_lua = "[Lua]",
|
||||
-- latex_symbols = "[Latex]",
|
||||
-- })
|
||||
-- }),
|
||||
-- },
|
||||
view = {
|
||||
entries = {name = 'custom', selection_order = 'near_cursor' }
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
@ -1,16 +0,0 @@
|
||||
return {
|
||||
"ojroques/nvim-osc52",
|
||||
config = function()
|
||||
require('osc52').setup {
|
||||
max_length = 0, -- Maximum length of selection (0 for no limit)
|
||||
silent = false, -- Show message when copied
|
||||
trim = false, -- Trim surrounding whitespaces before copy
|
||||
}
|
||||
|
||||
-- Key mappings
|
||||
vim.keymap.set('n', '<leader>y', require('osc52').copy_operator, {expr = true})
|
||||
vim.keymap.set('n', '<leader>yy', '<leader>y_', {remap = true})
|
||||
vim.keymap.set('v', '<leader>y', require('osc52').copy_visual)
|
||||
end,
|
||||
}
|
||||
|
||||
@ -1,6 +0,0 @@
|
||||
-- Adds delete functionality to quickfix list (keymap dd)
|
||||
return {
|
||||
-- https://github.com/TamaMcGlinn/quickfixdd
|
||||
"TamaMcGlinn/quickfixdd",
|
||||
event = "VeryLazy",
|
||||
}
|
||||
@ -1,8 +0,0 @@
|
||||
return {
|
||||
"gbprod/substitute.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = function()
|
||||
local substitute = require("substitute")
|
||||
substitute.setup()
|
||||
end,
|
||||
}
|
||||
@ -1,6 +0,0 @@
|
||||
return {
|
||||
"kylechui/nvim-surround",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
version = "*", -- Use for stability; omit to use `main` branch for the latest features
|
||||
config = true,
|
||||
}
|
||||
@ -1,38 +0,0 @@
|
||||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
branch = "0.1.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
"folke/todo-comments.nvim",
|
||||
},
|
||||
lazy = true,
|
||||
config = function()
|
||||
local telescope = require("telescope")
|
||||
local actions = require("telescope.actions")
|
||||
require("telescope").load_extension("flutter")
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
layout_strategy = "flex",
|
||||
layout_config = {
|
||||
height = 0.72,
|
||||
width = 0.65,
|
||||
prompt_position = "bottom",
|
||||
horizontal = {preview_width=0.65},
|
||||
vertical = {preview_height=0.65},
|
||||
},
|
||||
path_display = { "smart" },
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-k>"] = actions.move_selection_previous, -- move to prev result
|
||||
["<C-j>"] = actions.move_selection_next, -- move to next result
|
||||
["<C-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
telescope.load_extension("fzf")
|
||||
end,
|
||||
}
|
||||
|
||||
@ -1,9 +0,0 @@
|
||||
return {
|
||||
"folke/todo-comments.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
local todo_comments = require("todo-comments")
|
||||
todo_comments.setup()
|
||||
end,
|
||||
}
|
||||
@ -1,49 +0,0 @@
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
build = ":TSUpdate",
|
||||
dependencies = {
|
||||
"windwp/nvim-ts-autotag",
|
||||
},
|
||||
config = function()
|
||||
-- import nvim-treesitter plugin
|
||||
local treesitter = require("nvim-treesitter.configs")
|
||||
|
||||
-- configure treesitter
|
||||
treesitter.setup({ -- enable syntax highlighting
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
-- enable indentation
|
||||
indent = { enable = true },
|
||||
-- enable autotagging (w/ nvim-ts-autotag plugin)
|
||||
autotag = {
|
||||
enable = true,
|
||||
},
|
||||
-- ensure these language parsers are installed
|
||||
auto_install = true,
|
||||
ensure_installed = {
|
||||
"html",
|
||||
"css",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"bash",
|
||||
"lua",
|
||||
"dockerfile",
|
||||
"query",
|
||||
"c",
|
||||
"python",
|
||||
"sql",
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<C-space>",
|
||||
node_incremental = "<C-space>",
|
||||
scope_incremental = false,
|
||||
node_decremental = "<bs>",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
@ -1,22 +0,0 @@
|
||||
return {
|
||||
"folke/trouble.nvim",
|
||||
opts = {},
|
||||
cmd = "Trouble",
|
||||
-- dependencies = { "nvim-tree/nvim-web-devicons", "folke/todo-comments.nvim" },
|
||||
keys = {
|
||||
{ "<leader>xx", "<cmd>Trouble diagnostics toggle<CR>", desc = "Open/close trouble list" },
|
||||
{ "<leader>xL", "<cmd>Trouble loclist toggle<CR>", desc = "Open trouble location list diagnostics" },
|
||||
{
|
||||
"<leader>xd",
|
||||
"<cmd>Trouble diagnostics toggle filter.buf=0<CR>",
|
||||
desc = "Open trouble document diagnostics",
|
||||
},
|
||||
{ "<leader>xq", "<cmd>Trouble qflist toggle<CR>", desc = "Open trouble quickfix list" },
|
||||
{
|
||||
"<leader>xl",
|
||||
"<cmd>Trouble lsp toggle focus=false win.position=right<CR>",
|
||||
desc = "LSP Definitions / references (Trouble)",
|
||||
},
|
||||
{ "<leader>xt", "<cmd>TodoTrouble<CR>", desc = "Open todos in trouble" },
|
||||
},
|
||||
}
|
||||
@ -1,3 +0,0 @@
|
||||
return {
|
||||
"szw/vim-maximizer",
|
||||
}
|
||||
@ -1,23 +0,0 @@
|
||||
return {
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>?",
|
||||
function()
|
||||
require("which-key").show({ global = false })
|
||||
end,
|
||||
desc = "Buffer Local Keymaps (which-key)",
|
||||
},
|
||||
},
|
||||
config = function(...) require "enrique.core.keymaps" (...) end
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
98
nvim/lua/plugins/blink-cmp.lua
Normal file
98
nvim/lua/plugins/blink-cmp.lua
Normal file
@ -0,0 +1,98 @@
|
||||
return { -- Autowcompletion
|
||||
"saghen/blink.cmp",
|
||||
event = "VimEnter",
|
||||
version = "1.*",
|
||||
dependencies = {
|
||||
-- Snippet Engine
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
version = "2.*",
|
||||
build = (function()
|
||||
-- Build Step is needed for regex support in snippets.
|
||||
-- This step is not supported in many windows environments.
|
||||
if vim.fn.has("win32") == 1 or vim.fn.executable("make") == 0 then
|
||||
return
|
||||
end
|
||||
return "make install_jsregexp"
|
||||
end)(),
|
||||
dependencies = {
|
||||
-- https://github.com/rafamadriz/friendly-snippets
|
||||
{
|
||||
"rafamadriz/friendly-snippets",
|
||||
config = function()
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
end,
|
||||
},
|
||||
},
|
||||
opts = {},
|
||||
},
|
||||
"folke/lazydev.nvim",
|
||||
"moyiz/blink-emoji.nvim",
|
||||
},
|
||||
--- @module 'blink.cmp'
|
||||
--- @type blink.cmp.Config
|
||||
opts = {
|
||||
keymap = {
|
||||
-- 'default' (recommended) for mappings similar to built-in completions
|
||||
-- <c-y> to accept ([y]es) the completion.
|
||||
-- This will auto-import if your LSP supports it.
|
||||
-- This will expand snippets if the LSP sent a snippet.
|
||||
-- 'super-tab' for tab to accept
|
||||
-- 'enter' for enter to accept
|
||||
-- 'none' for no mappings
|
||||
--
|
||||
-- All presets have the following mappings:
|
||||
-- <tab>/<s-tab>: move to right/left of your snippet expansion
|
||||
-- <c-space>: Open menu or open docs if already open
|
||||
-- <c-n>/<c-p> or <up>/<down>: Select next/previous item
|
||||
-- <c-e>: Hide menu
|
||||
-- <c-k>: Toggle signature help
|
||||
-- See :h blink-cmp-config-keymap for defining your own keymap
|
||||
preset = "super-tab",
|
||||
},
|
||||
|
||||
appearance = {
|
||||
-- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
|
||||
nerd_font_variant = "mono",
|
||||
},
|
||||
|
||||
completion = {
|
||||
-- By default, you may press `<c-space>` to show the documentation.
|
||||
documentation = { auto_show = true, auto_show_delay_ms = 500 },
|
||||
menu = {
|
||||
border = "rounded",
|
||||
},
|
||||
ghost_text = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
|
||||
-- Shows a signature help window while you type arguments for a function
|
||||
signature = { enabled = true },
|
||||
|
||||
sources = {
|
||||
default = { "lsp", "path", "snippets", "lazydev" },
|
||||
providers = {
|
||||
lazydev = { module = "lazydev.integrations.blink", score_offset = 100 },
|
||||
emoji = {
|
||||
module = "blink-emoji",
|
||||
name = "Emoji",
|
||||
score_offset = 15, -- Tune by preference
|
||||
opts = { insert = true }, -- Insert emoji (default) or complete its name
|
||||
-- should_show_items = function()
|
||||
-- return vim.tbl_contains(
|
||||
-- -- Enable emoji completion only for git commits and markdown.
|
||||
-- -- By default, enabled for all file-types.
|
||||
-- { "gitcommit", "markdown" },
|
||||
-- vim.o.filetype
|
||||
-- )
|
||||
-- end,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- snippets = { preset = "luasnip" },
|
||||
|
||||
fuzzy = { implementation = "prefer_rust_with_warning" },
|
||||
},
|
||||
}
|
||||
12
nvim/lua/plugins/colorscheme.lua
Normal file
12
nvim/lua/plugins/colorscheme.lua
Normal file
@ -0,0 +1,12 @@
|
||||
return {
|
||||
"folke/tokyonight.nvim",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
config = function()
|
||||
require("tokyonight").setup {
|
||||
style = "storm",
|
||||
transparent = true,
|
||||
}
|
||||
vim.cmd("colorscheme tokyonight")
|
||||
end
|
||||
}
|
||||
15
nvim/lua/plugins/conform.lua
Normal file
15
nvim/lua/plugins/conform.lua
Normal file
@ -0,0 +1,15 @@
|
||||
return {
|
||||
"stevearc/conform.nvim",
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
go = { "goimports", "gofumpt", lsp_format = "fallback" },
|
||||
lua = { "stylua" },
|
||||
python = { "isort", "black" },
|
||||
bash = { "beautysh" },
|
||||
},
|
||||
format_on_save = {
|
||||
timeout_ms = 500,
|
||||
lsp_format = "falback",
|
||||
},
|
||||
},
|
||||
}
|
||||
4
nvim/lua/plugins/dressing.lua
Normal file
4
nvim/lua/plugins/dressing.lua
Normal file
@ -0,0 +1,4 @@
|
||||
return {
|
||||
'stevearc/dressing.nvim',
|
||||
opts = {},
|
||||
}
|
||||
32
nvim/lua/plugins/flutter-tools.lua
Normal file
32
nvim/lua/plugins/flutter-tools.lua
Normal file
@ -0,0 +1,32 @@
|
||||
return {
|
||||
"akinsho/flutter-tools.nvim",
|
||||
lazy = false,
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"stevearc/dressing.nvim", -- optional for vim.ui.select
|
||||
},
|
||||
config = function()
|
||||
require("flutter-tools").setup({
|
||||
ui = {
|
||||
border = "shadow",
|
||||
},
|
||||
decorations = {
|
||||
statusline = {
|
||||
device = true,
|
||||
},
|
||||
},
|
||||
closing_tags = {
|
||||
prefix = "••• ",
|
||||
enabled = true,
|
||||
},
|
||||
lsp = {
|
||||
color = {
|
||||
enabled = true,
|
||||
background = true,
|
||||
virtual_text = true,
|
||||
virtual_text_str = "",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
8
nvim/lua/plugins/fzf.lua
Normal file
8
nvim/lua/plugins/fzf.lua
Normal file
@ -0,0 +1,8 @@
|
||||
return {
|
||||
"ibhagwan/fzf-lua",
|
||||
-- optional for icon support
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
-- or if using mini.icons/mini.nvim
|
||||
-- dependencies = { "echasnovski/mini.icons" },
|
||||
opts = {}
|
||||
}
|
||||
236
nvim/lua/plugins/lsp.lua
Normal file
236
nvim/lua/plugins/lsp.lua
Normal file
@ -0,0 +1,236 @@
|
||||
return {
|
||||
-- LSP Plugins
|
||||
{
|
||||
"folke/lazydev.nvim",
|
||||
ft = "lua",
|
||||
opts = {
|
||||
library = {
|
||||
-- Load luvit types when the `vim.uv` word is found
|
||||
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
-- Main LSP Configuration
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
{ "williamboman/mason.nvim", opts = {} },
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
"WhoIsSethDaniel/mason-tool-installer.nvim",
|
||||
|
||||
-- Useful status updates for LSP.
|
||||
{ "j-hui/fidget.nvim", opts = {} },
|
||||
|
||||
-- Allows extra capabilities provided by blink.cmp
|
||||
"saghen/blink.cmp",
|
||||
},
|
||||
config = function()
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = vim.api.nvim_create_augroup("lsp-attach", { clear = true }),
|
||||
callback = function(event)
|
||||
local wk = require("which-key")
|
||||
|
||||
local function wkAdd(keys, func, desc, mode)
|
||||
mode = mode or "n"
|
||||
wk.add({ keys, func, desc = desc, mode = mode })
|
||||
end
|
||||
|
||||
local function wkGroup(keys, group, modes)
|
||||
modes = modes or { "n" }
|
||||
wk.add({ keys, group = group, mode = modes })
|
||||
end
|
||||
|
||||
wkGroup("<leader>c", "LSP & code actions")
|
||||
wkAdd("<leader>cr", vim.lsp.buf.rename, "[C]ode [R]ename")
|
||||
wkAdd("<leader>cf", function()
|
||||
require("conform").format()
|
||||
end, "[C]ode [F]ormat")
|
||||
wkAdd("<leader>ca", vim.lsp.buf.code_action, "[C]ode [A]ction", { "n", "x" })
|
||||
wkAdd("<leader>cgr", require("fzf-lua").lsp_references, "[G]oto [R]eferences")
|
||||
wkAdd("<leader>cgi", require("fzf-lua").lsp_implementations, "[G]oto [I]mplementation")
|
||||
-- To jump back, press <C-t>.
|
||||
wkAdd("<leader>cgd", require("fzf-lua").lsp_definitions, "[G]oto [D]efinition")
|
||||
wkAdd("<leader>cgD", vim.lsp.buf.declaration, "[G]oto [D]eclaration")
|
||||
wkAdd("<leader>cO", require("fzf-lua").lsp_document_symbols, "Open Document Symbols")
|
||||
wkAdd("<leader>cW", require("fzf-lua").lsp_live_workspace_symbols, "Open Workspace Symbols")
|
||||
wkAdd("<leader>cgt", require("fzf-lua").lsp_typedefs, "[G]oto [T]ype Definition")
|
||||
wkAdd("<leader>ch", vim.lsp.buf.hover, "Toggle LSP hover (documantation)")
|
||||
wkAdd("<leader>clr", "<cmd>LspRestart<cr>", "Restart LSP")
|
||||
wkAdd("<leader>cI", "<cmd>LspInfo<cr>", "Show LSP Info")
|
||||
|
||||
-- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10)
|
||||
---@param client vim.lsp.Client
|
||||
---@param method vim.lsp.protocol.Method
|
||||
---@param bufnr? integer some lsp support methods only in specific files
|
||||
---@return boolean
|
||||
local function client_supports_method(client, method, bufnr)
|
||||
if vim.fn.has("nvim-0.11") == 1 then
|
||||
return client:supports_method(method, bufnr)
|
||||
else
|
||||
return client.supports_method(method, { bufnr = bufnr })
|
||||
end
|
||||
end
|
||||
|
||||
-- The following two autocommands are used to highlight references of the
|
||||
-- word under your cursor when your cursor rests there for a little while.
|
||||
-- See `:help CursorHold` for information about when this is executed
|
||||
--
|
||||
-- When you move your cursor, the highlights will be cleared (the second autocommand).
|
||||
local client = vim.lsp.get_client_by_id(event.data.client_id)
|
||||
if
|
||||
client
|
||||
and client_supports_method(
|
||||
client,
|
||||
vim.lsp.protocol.Methods.textDocument_documentHighlight,
|
||||
event.buf
|
||||
)
|
||||
then
|
||||
local highlight_augroup = vim.api.nvim_create_augroup("lsp-highlight", { clear = false })
|
||||
vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
|
||||
buffer = event.buf,
|
||||
group = highlight_augroup,
|
||||
callback = vim.lsp.buf.document_highlight,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, {
|
||||
buffer = event.buf,
|
||||
group = highlight_augroup,
|
||||
callback = vim.lsp.buf.clear_references,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("LspDetach", {
|
||||
group = vim.api.nvim_create_augroup("lsp-detach", { clear = true }),
|
||||
callback = function(event2)
|
||||
vim.lsp.buf.clear_references()
|
||||
vim.api.nvim_clear_autocmds({ group = "lsp-highlight", buffer = event2.buf })
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
-- The following code creates a keymap to toggle inlay hints
|
||||
if
|
||||
client
|
||||
and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf)
|
||||
then
|
||||
wkAdd("<leader>cH", function()
|
||||
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = event.buf }))
|
||||
end, "[T]oggle Inlay [H]ints")
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- Diagnostic Config
|
||||
-- See :help vim.diagnostic.Opts
|
||||
vim.diagnostic.config({
|
||||
severity_sort = true,
|
||||
float = { border = "rounded", source = "if_many" },
|
||||
underline = { severity = vim.diagnostic.severity.ERROR },
|
||||
signs = vim.g.have_nerd_font and {
|
||||
text = {
|
||||
[vim.diagnostic.severity.ERROR] = " ",
|
||||
[vim.diagnostic.severity.WARN] = " ",
|
||||
[vim.diagnostic.severity.INFO] = " ",
|
||||
[vim.diagnostic.severity.HINT] = " ",
|
||||
},
|
||||
} or {},
|
||||
virtual_text = {
|
||||
source = "if_many",
|
||||
spacing = 2,
|
||||
format = function(diagnostic)
|
||||
local diagnostic_message = {
|
||||
[vim.diagnostic.severity.ERROR] = diagnostic.message,
|
||||
[vim.diagnostic.severity.WARN] = diagnostic.message,
|
||||
[vim.diagnostic.severity.INFO] = diagnostic.message,
|
||||
[vim.diagnostic.severity.HINT] = diagnostic.message,
|
||||
}
|
||||
return diagnostic_message[diagnostic.severity]
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
||||
-- When you add blink.cmp, luasnip, etc. Neovim now has *more* capabilities.
|
||||
local original_capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
local capabilities = require("blink.cmp").get_lsp_capabilities(original_capabilities)
|
||||
|
||||
-- Add any additional override configuration in the following tables. Available keys:
|
||||
-- - cmd (table): Override the default command used to start the server
|
||||
-- - filetypes (table): Override the default list of associated filetypes for the server
|
||||
-- - capabilities (table): Override fields in capabilities. Can be used to disable certain LSP features.
|
||||
-- - settings (table): Override the default settings passed when initializing the server.
|
||||
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
|
||||
local servers = {
|
||||
gopls = {
|
||||
settings = {
|
||||
gopls = {
|
||||
gofumpt = true,
|
||||
codelenses = {
|
||||
gc_details = false,
|
||||
generate = true,
|
||||
regenerate_cgo = true,
|
||||
run_govulncheck = true,
|
||||
test = true,
|
||||
tidy = true,
|
||||
upgrade_dependency = true,
|
||||
vendor = true,
|
||||
},
|
||||
hints = {
|
||||
assignVariableTypes = true,
|
||||
compositeLiteralFields = true,
|
||||
compositeLiteralTypes = true,
|
||||
constantValues = true,
|
||||
functionTypeParameters = true,
|
||||
parameterNames = true,
|
||||
rangeVariableTypes = true,
|
||||
},
|
||||
analyses = {
|
||||
nilness = true,
|
||||
unusedparams = true,
|
||||
unusedwrite = true,
|
||||
useany = true,
|
||||
},
|
||||
usePlaceholders = true,
|
||||
completeUnimported = true,
|
||||
staticcheck = true,
|
||||
semanticTokens = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
pyright = {},
|
||||
lua_ls = {},
|
||||
bashls = {},
|
||||
marksman = {},
|
||||
}
|
||||
|
||||
-- You can add other tools here that you want Mason to install
|
||||
-- for you, so that they are available from within Neovim.
|
||||
local ensure_installed = vim.tbl_keys(servers or {})
|
||||
vim.list_extend(ensure_installed, {
|
||||
"goimports",
|
||||
"gofumpt",
|
||||
"gomodifytags",
|
||||
"impl",
|
||||
"stylua", -- Used to format Lua code
|
||||
"isort",
|
||||
"black",
|
||||
"black",
|
||||
"beautysh",
|
||||
})
|
||||
require("mason-tool-installer").setup({ ensure_installed = ensure_installed })
|
||||
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = {},
|
||||
automatic_installation = false,
|
||||
handlers = {
|
||||
function(server_name)
|
||||
local server = servers[server_name] or {}
|
||||
-- This handles overriding only values explicitly passed
|
||||
-- by the server configuration above. Useful when disabling
|
||||
-- certain features of an LSP (for example, turning off formatting for ts_ls)
|
||||
server.capabilities = vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {})
|
||||
require("lspconfig")[server_name].setup(server)
|
||||
end,
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
17
nvim/lua/plugins/mini-files.lua.bak
Normal file
17
nvim/lua/plugins/mini-files.lua.bak
Normal file
@ -0,0 +1,17 @@
|
||||
return {
|
||||
'echasnovski/mini.files',
|
||||
version = '*',
|
||||
opts = {
|
||||
options = {
|
||||
permanent_delete = false,
|
||||
use_as_default_explorer = true,
|
||||
},
|
||||
windows = {
|
||||
preview = true,
|
||||
width_focus = 50,
|
||||
width_nofocus = 15,
|
||||
-- Width of preview window
|
||||
width_preview = 72,
|
||||
},
|
||||
}
|
||||
}
|
||||
59
nvim/lua/plugins/mini-nvim.lua
Normal file
59
nvim/lua/plugins/mini-nvim.lua
Normal file
@ -0,0 +1,59 @@
|
||||
return {
|
||||
"echasnovski/mini.nvim",
|
||||
version = "*",
|
||||
config = function()
|
||||
require("mini.ai").setup()
|
||||
require("mini.comment").setup()
|
||||
require("mini.move").setup()
|
||||
require("mini.operators").setup()
|
||||
require("mini.pairs").setup()
|
||||
require("mini.splitjoin").setup()
|
||||
require("mini.bracketed").setup()
|
||||
require("mini.jump").setup()
|
||||
require("mini.tabline").setup()
|
||||
require("mini.statusline").setup()
|
||||
require("mini.cursorword").setup()
|
||||
|
||||
require("mini.notify").setup({
|
||||
lsp_progress = {
|
||||
enable = false,
|
||||
},
|
||||
})
|
||||
|
||||
require("mini.surround").setup({
|
||||
mappings = {
|
||||
add = "<leader>w+",
|
||||
delete = "<leader>w-",
|
||||
find = "<leader>wf",
|
||||
find_left = "<leader>wF",
|
||||
highlight = "<leader>wh",
|
||||
replace = "<leader>wr",
|
||||
update_n_lines = "",
|
||||
},
|
||||
})
|
||||
|
||||
require("mini.indentscope").setup({
|
||||
delay = 50,
|
||||
animation = 5,
|
||||
})
|
||||
|
||||
require("mini.jump2d").setup({
|
||||
mappings = {
|
||||
start_jumping = "<leader><esc><cr>",
|
||||
},
|
||||
})
|
||||
|
||||
require("mini.hipatterns").setup({
|
||||
highlighters = {
|
||||
-- Highlight standalone 'FIXME', 'HACK', 'TODO', 'NOTE'
|
||||
fixme = { pattern = "%f[%w]()FIXME()%f[%W]", group = "MiniHipatternsFixme" },
|
||||
hack = { pattern = "%f[%w]()HACK()%f[%W]", group = "MiniHipatternsHack" },
|
||||
todo = { pattern = "%f[%w]()TODO()%f[%W]", group = "MiniHipatternsTodo" },
|
||||
note = { pattern = "%f[%w]()NOTE()%f[%W]", group = "MiniHipatternsNote" },
|
||||
|
||||
-- Highlight hex color strings (`#rrggbb`) using that color
|
||||
hex_color = require("mini.hipatterns").gen_highlighter.hex_color(),
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
15
nvim/lua/plugins/noice.lua
Normal file
15
nvim/lua/plugins/noice.lua
Normal file
@ -0,0 +1,15 @@
|
||||
return {
|
||||
"folke/noice.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
-- add any options here
|
||||
},
|
||||
dependencies = {
|
||||
-- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
|
||||
"MunifTanjim/nui.nvim",
|
||||
-- OPTIONAL:
|
||||
-- `nvim-notify` is only needed, if you want to use the notification view.
|
||||
-- If not available, we use `mini` as the fallback
|
||||
-- "rcarriga/nvim-notify",
|
||||
},
|
||||
}
|
||||
82
nvim/lua/plugins/oil-fm.lua
Normal file
82
nvim/lua/plugins/oil-fm.lua
Normal file
@ -0,0 +1,82 @@
|
||||
return {
|
||||
"stevearc/oil.nvim",
|
||||
---@module 'oil'
|
||||
---@type oil.SetupOpts
|
||||
opts = {
|
||||
default_view = "float",
|
||||
columns = {
|
||||
"icon",
|
||||
-- "permissions",
|
||||
-- "size",
|
||||
-- "mtime",
|
||||
},
|
||||
delete_to_trash = true,
|
||||
skip_confirm_for_simple_edits = false,
|
||||
prompt_save_on_select_new_entry = true,
|
||||
-- Set to `false` to disable, or "name" to keep it on the file names
|
||||
constrain_cursor = "name",
|
||||
-- Set to `false` to remove a keymap
|
||||
keymaps = {
|
||||
["g?"] = { "actions.show_help", mode = "n" },
|
||||
["<CR>"] = "actions.select",
|
||||
["<C-s>"] = { "actions.select", opts = { vertical = true } },
|
||||
["<C-h>"] = { "actions.select", opts = { horizontal = true } },
|
||||
["<C-t>"] = { "actions.select", opts = { tab = true } },
|
||||
["<C-p>"] = "actions.preview",
|
||||
["q"] = { "actions.close", mode = "n" },
|
||||
["R"] = "actions.refresh",
|
||||
["<bs>"] = { "actions.parent", mode = "n" },
|
||||
["_"] = { "actions.open_cwd", mode = "n" },
|
||||
["`"] = { "actions.cd", mode = "n" },
|
||||
["~"] = { "actions.cd", opts = { scope = "tab" }, mode = "n" },
|
||||
["gs"] = { "actions.change_sort", mode = "n" },
|
||||
["gx"] = "actions.open_external",
|
||||
["g."] = { "actions.toggle_hidden", mode = "n" },
|
||||
["g\\"] = { "actions.toggle_trash", mode = "n" },
|
||||
},
|
||||
-- Set to false to disable all of the above keymaps
|
||||
use_default_keymaps = true,
|
||||
view_options = {
|
||||
show_hidden = false,
|
||||
-- Can be "fast", true, or false. "fast" will turn it off for large directories.
|
||||
natural_order = "fast",
|
||||
case_insensitive = false,
|
||||
},
|
||||
-- Configuration for the floating window in oil.open_float
|
||||
float = {
|
||||
padding = 13,
|
||||
max_width = 0.8,
|
||||
max_height = 0.8,
|
||||
border = "rounded",
|
||||
win_options = {
|
||||
winblend = 0,
|
||||
},
|
||||
preview_split = "auto",
|
||||
},
|
||||
-- Configuration for the floating action confirmation window
|
||||
confirmation = {
|
||||
-- max_width = {100, 0.8} means "the lesser of 100 columns or 80% of total"
|
||||
max_width = 0.9,
|
||||
min_width = { 40, 0.4 },
|
||||
max_height = 0.9,
|
||||
min_height = { 5, 0.1 },
|
||||
border = "rounded",
|
||||
win_options = {
|
||||
winblend = 0,
|
||||
},
|
||||
},
|
||||
-- Configuration for the floating progress window
|
||||
progress = {
|
||||
max_width = 0.9,
|
||||
min_width = { 40, 0.4 },
|
||||
max_height = { 10, 0.9 },
|
||||
min_height = { 5, 0.1 },
|
||||
border = "rounded",
|
||||
win_options = {
|
||||
winblend = 0,
|
||||
},
|
||||
},
|
||||
},
|
||||
dependencies = { { "echasnovski/mini.icons", opts = {} } },
|
||||
lazy = false,
|
||||
}
|
||||
6
nvim/lua/plugins/project-nvim.lua
Normal file
6
nvim/lua/plugins/project-nvim.lua
Normal file
@ -0,0 +1,6 @@
|
||||
return {
|
||||
"ahmedkhalf/project.nvim",
|
||||
init = function()
|
||||
require("project_nvim").setup {}
|
||||
end
|
||||
}
|
||||
5
nvim/lua/plugins/sleuth.lua
Normal file
5
nvim/lua/plugins/sleuth.lua
Normal file
@ -0,0 +1,5 @@
|
||||
return {
|
||||
"tpope/vim-sleuth",
|
||||
-- No further initialization needed, as this is a real "vim" not a lua
|
||||
-- plugin.
|
||||
}
|
||||
4
nvim/lua/plugins/smear-cursor.lua
Normal file
4
nvim/lua/plugins/smear-cursor.lua
Normal file
@ -0,0 +1,4 @@
|
||||
return {
|
||||
"sphamba/smear-cursor.nvim",
|
||||
opts = {},
|
||||
}
|
||||
8
nvim/lua/plugins/substitue.lua
Normal file
8
nvim/lua/plugins/substitue.lua
Normal file
@ -0,0 +1,8 @@
|
||||
return {
|
||||
"gbprod/substitute.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = function()
|
||||
local substitute = require("substitute")
|
||||
substitute.setup()
|
||||
end,
|
||||
}
|
||||
30
nvim/lua/plugins/toggleterm.lua
Normal file
30
nvim/lua/plugins/toggleterm.lua
Normal file
@ -0,0 +1,30 @@
|
||||
return {
|
||||
"akinsho/toggleterm.nvim",
|
||||
version = "*",
|
||||
opts = {
|
||||
size = function(term)
|
||||
if term.direction == "horizontal" then
|
||||
return 15
|
||||
elseif term.direction == "vertical" then
|
||||
return vim.o.columns * 0.4
|
||||
end
|
||||
end,
|
||||
open_mapping = "<leader>tt",
|
||||
start_in_insert = true,
|
||||
insert_mappings = false,
|
||||
persist_size = false,
|
||||
direction = "float",
|
||||
float_opts = {
|
||||
border = "curved",
|
||||
width = function()
|
||||
return math.floor(vim.o.columns * 0.75)
|
||||
end,
|
||||
height = function()
|
||||
return math.floor(vim.o.lines * 0.75)
|
||||
end,
|
||||
},
|
||||
|
||||
-- Check if 'fish' is executable, otherwise use Neovim's default shell
|
||||
shell = vim.fn.executable("fish") == 1 and "fish" or vim.o.shell,
|
||||
},
|
||||
}
|
||||
79
nvim/lua/plugins/treesitter.lua
Normal file
79
nvim/lua/plugins/treesitter.lua
Normal file
@ -0,0 +1,79 @@
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
local configs = require("nvim-treesitter.configs")
|
||||
configs.setup({
|
||||
ensure_installed = {
|
||||
"go",
|
||||
"gomod",
|
||||
"gowork",
|
||||
"gosum",
|
||||
"lua",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"query",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"dart",
|
||||
"python",
|
||||
},
|
||||
auto_install = true,
|
||||
highlight = {
|
||||
enable = true,
|
||||
disable = function(lang, buf)
|
||||
local max_filesize = 200 * 1024 -- 100 KB
|
||||
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
|
||||
if ok and stats and stats.size > max_filesize then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
},
|
||||
indent = { enable = true, disable = { "ruby" } },
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<enter>",
|
||||
node_incremental = "<enter>",
|
||||
scope_incremental = false,
|
||||
node_decremental = "<bs>",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
},
|
||||
init = function()
|
||||
local config = require("nvim-treesitter.configs")
|
||||
config.setup({
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
-- Automatically jump forward to textobj, similar to targets.vim
|
||||
lookahead = true,
|
||||
selection_modes = {
|
||||
["@parameter.outer"] = "v", -- charwise
|
||||
["@function.outer"] = "V", -- linewise
|
||||
["@class.outer"] = "<c-v>", -- blockwise
|
||||
},
|
||||
include_surrounding_whitespace = true,
|
||||
},
|
||||
swap = {
|
||||
enable = true,
|
||||
swap_next = {
|
||||
["<leader>csa"] = { query = "@parameter.inner", desc = "Swap with next parameter" },
|
||||
},
|
||||
swap_previous = {
|
||||
["<leader>csA"] = "@parameter.inner",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
58
nvim/lua/plugins/whichkey.lua
Normal file
58
nvim/lua/plugins/whichkey.lua
Normal file
@ -0,0 +1,58 @@
|
||||
return {
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
delay = 0,
|
||||
icons = {
|
||||
mappings = vim.g.have_nerd_font,
|
||||
-- If you are using a Nerd Font: set icons.keys to an empty table which will use the
|
||||
-- default which-key.nvim defined Nerd Font icons, otherwise define a string table
|
||||
keys = vim.g.have_nerd_font and {} or {
|
||||
Up = "<Up> ",
|
||||
Down = "<Down> ",
|
||||
Left = "<Left> ",
|
||||
Right = "<Right> ",
|
||||
C = "<C-…> ",
|
||||
M = "<M-…> ",
|
||||
D = "<D-…> ",
|
||||
S = "<S-…> ",
|
||||
CR = "<CR> ",
|
||||
Esc = "<Esc> ",
|
||||
ScrollWheelDown = "<ScrollWheelDown> ",
|
||||
ScrollWheelUp = "<ScrollWheelUp> ",
|
||||
NL = "<NL> ",
|
||||
BS = "<BS> ",
|
||||
Space = "<Space> ",
|
||||
Tab = "<Tab> ",
|
||||
F1 = "<F1>",
|
||||
F2 = "<F2>",
|
||||
F3 = "<F3>",
|
||||
F4 = "<F4>",
|
||||
F5 = "<F5>",
|
||||
F6 = "<F6>",
|
||||
F7 = "<F7>",
|
||||
F8 = "<F8>",
|
||||
F9 = "<F9>",
|
||||
F10 = "<F10>",
|
||||
F11 = "<F11>",
|
||||
F12 = "<F12>",
|
||||
},
|
||||
},
|
||||
|
||||
-- Document existing key chains
|
||||
-- spec = {
|
||||
-- { '<leader>s', group = '[S]earch' },
|
||||
-- { '<leader>t', group = '[T]oggle' },
|
||||
-- { '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } },
|
||||
-- },
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"??",
|
||||
function()
|
||||
require("which-key").show({ global = false })
|
||||
end,
|
||||
desc = "Buffer Local Keymaps (which-key)",
|
||||
},
|
||||
},
|
||||
}
|
||||
7
nvim/test.go
Normal file
7
nvim/test.go
Normal file
@ -0,0 +1,7 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
fmt.Println("Hello world!")
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user