Add neovim config
This commit is contained in:
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
.DS_Store
|
||||
nvim/lazy-lock.json
|
||||
nvim/lazyvim.json
|
||||
1
README.md
Normal file
1
README.md
Normal file
@@ -0,0 +1 @@
|
||||
Файлы необходимо распологать в директории `~/.config`
|
||||
44
nvim/Requirements.md
Normal file
44
nvim/Requirements.md
Normal file
@@ -0,0 +1,44 @@
|
||||
### NB
|
||||
|
||||
Мой предпочитаемый вариант установки [brew](https://brew.sh/), но так же можно найти репозитории необходимых зависимостей и учтановить их другими методами.
|
||||
|
||||
### Установка neovim
|
||||
|
||||
```bash
|
||||
# https://github.com/neovim/neovim
|
||||
brew install neovim
|
||||
```
|
||||
|
||||
### Установка зависимостей
|
||||
|
||||
```bash
|
||||
# https://github.com/junegunn/fzf
|
||||
brew install fzf
|
||||
|
||||
# https://github.com/alesbrelih/gitlab-ci-ls
|
||||
brew install alesbrelih/gitlab-ci-ls/gitlab-ci-ls
|
||||
|
||||
# https://github.com/golang/go
|
||||
brew install go
|
||||
|
||||
# https://github.com/jesseduffield/lazygit
|
||||
brew install lazygit
|
||||
|
||||
# https://github.com/LuaLS/lua-language-server
|
||||
brew install lua-language-server
|
||||
|
||||
# https://github.com/getsops/sops
|
||||
brew onstall sops
|
||||
|
||||
# https://github.com/hashicorp/terraform-ls
|
||||
brew install terraform-ls
|
||||
|
||||
# https://tree-sitter.github.io/
|
||||
brew install tree-sitter
|
||||
|
||||
# https://github.com/redhat-developer/yaml-language-server
|
||||
brew install yaml-language-server
|
||||
|
||||
# https://github.com/ryanoasis/nerd-fonts
|
||||
brew install --cask font-jetbrains-mono-nerd-font
|
||||
```
|
||||
16
nvim/filetype.lua
Normal file
16
nvim/filetype.lua
Normal file
@@ -0,0 +1,16 @@
|
||||
-- Gitlab CI LSP
|
||||
vim.filetype.add({
|
||||
pattern = {
|
||||
['%.gitlab%-ci%.ya?ml'] = 'yaml.gitlab',
|
||||
},
|
||||
})
|
||||
|
||||
-- Terraform LSP
|
||||
vim.filetype.add({
|
||||
filename = {
|
||||
['variables.tf'] = 'terraform.vars'
|
||||
},
|
||||
pattern = {
|
||||
['.*%.tfvars'] = 'terraform.vars'
|
||||
},
|
||||
})
|
||||
1
nvim/init.lua
Normal file
1
nvim/init.lua
Normal file
@@ -0,0 +1 @@
|
||||
require("config")
|
||||
12
nvim/lsp/gitlabcils.lua
Normal file
12
nvim/lsp/gitlabcils.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
-- https://github.com/neovim/nvim-lspconfig/blob/master/lsp/gitlab_ci_ls.lua
|
||||
local cache_dir = vim.uv.os_homedir() .. '/.cache/gitlab-ci-ls/'
|
||||
|
||||
return {
|
||||
cmd = { 'gitlab-ci-ls' },
|
||||
filetypes = { 'yaml.gitlab' },
|
||||
root_markers = { '.git', '.gitlab-ci.yml' },
|
||||
init_options = {
|
||||
cache_path = cache_dir,
|
||||
log_path = cache_dir .. '/log/gitlab-ci-ls.log',
|
||||
},
|
||||
}
|
||||
28
nvim/lsp/luals.lua
Normal file
28
nvim/lsp/luals.lua
Normal file
@@ -0,0 +1,28 @@
|
||||
-- https://github.com/neovim/nvim-lspconfig/blob/master/lsp/lua_ls.lua
|
||||
return {
|
||||
cmd = {
|
||||
"lua-language-server",
|
||||
},
|
||||
filetypes = {
|
||||
"lua",
|
||||
},
|
||||
root_markers = {
|
||||
".git",
|
||||
".luacheckrc",
|
||||
".luarc.json",
|
||||
".luarc.jsonc",
|
||||
".stylua.toml",
|
||||
"selene.toml",
|
||||
"selene.yml",
|
||||
"stylua.toml",
|
||||
},
|
||||
settings = {
|
||||
Lua = {
|
||||
workspace = {
|
||||
library = vim.api.nvim_get_runtime_file("", true)
|
||||
}
|
||||
}
|
||||
},
|
||||
single_file_support = true,
|
||||
log_level = vim.lsp.protocol.MessageType.Warning,
|
||||
}
|
||||
6
nvim/lsp/terraformls.lua
Normal file
6
nvim/lsp/terraformls.lua
Normal file
@@ -0,0 +1,6 @@
|
||||
-- https://github.com/neovim/nvim-lspconfig/blob/master/lsp/terraformls.lua
|
||||
return {
|
||||
cmd = { 'terraform-ls', 'serve' },
|
||||
filetypes = { 'terraform', 'terraform.vars' },
|
||||
root_markers = { '.terraform', '.git' },
|
||||
}
|
||||
18
nvim/lsp/yamlls.lua
Normal file
18
nvim/lsp/yamlls.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
-- https://github.com/neovim/nvim-lspconfig/blob/master/lsp/yamlls.lua
|
||||
return {
|
||||
cmd = { "yaml-language-server", "--stdio" },
|
||||
filetypes = { "yaml", 'yaml.docker-compose', 'yaml.gitlab', 'yaml.helm-values' },
|
||||
root_markers = { ".git" },
|
||||
settings = {
|
||||
redhat = {
|
||||
telemetry = {
|
||||
enabled = false
|
||||
}
|
||||
},
|
||||
yaml = {
|
||||
format = {
|
||||
enable = true
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
5
nvim/lua/config/init.lua
Normal file
5
nvim/lua/config/init.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
require("config.options")
|
||||
require("config.keymaps")
|
||||
require("config.lazy")
|
||||
require("config.lsp")
|
||||
|
||||
124
nvim/lua/config/keymaps.lua
Normal file
124
nvim/lua/config/keymaps.lua
Normal file
@@ -0,0 +1,124 @@
|
||||
-- Setup leader key
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
local keymap = vim.keymap
|
||||
|
||||
-- Vim modes:
|
||||
-- n Normal mode map. Defined using ':nmap' or ':nnoremap'.
|
||||
-- i Insert mode map. Defined using ':imap' or ':inoremap'.
|
||||
-- v Visual and select mode map. Defined using ':vmap' or ':vnoremap'.
|
||||
-- x Visual mode map. Defined using ':xmap' or ':xnoremap'.
|
||||
-- s Select mode map. Defined using ':smap' or ':snoremap'.
|
||||
-- c Command-line mode map. Defined using ':cmap' or ':cnoremap'.
|
||||
-- o Operator pending mode map. Defined using ':omap' or ':onoremap'.
|
||||
|
||||
-- Reserved firs characters:
|
||||
-- +/- - numbers
|
||||
-- c - [C]lear
|
||||
-- d - [D]iagnostic
|
||||
-- e - File [E]xplorer
|
||||
-- f - [F]ind
|
||||
-- g - [G]it
|
||||
-- h - [H]istory
|
||||
-- l - [L]SP
|
||||
-- n - [N]otifications
|
||||
-- p - [P]anes
|
||||
-- s - [S]ession
|
||||
-- t - [T]abs
|
||||
-- u - [U]i
|
||||
|
||||
-- [C]lear highlits
|
||||
keymap.set("n", "<leader>ch", ":nohl<CR>", { desc = "[C]lear: serch [h]ighlights" })
|
||||
|
||||
-- [D]iagnostic
|
||||
keymap.set("n", "<leader>dl", vim.diagnostic.open_float, { desc = "[D]iagnostic: [l]ine" })
|
||||
keymap.set("n", "K", vim.lsp.buf.hover, { desc = "Hover Documentation" })
|
||||
keymap.set({ "n", "v" }, "<leader>da", vim.lsp.buf.code_action, { desc = "[D]iagnostic: avalible code [a]ctions" })
|
||||
-- nvim-telescope/telescope.nvim
|
||||
keymap.set("n", "<leader>db", "<cmd>Telescope diagnostics bufnr=0<CR>", { desc = "[D]iagnostic: [b]uffer" })
|
||||
-- folke/trouble.nvim
|
||||
keymap.set("n", "<leader>dw", "<cmd>Trouble diagnostics toggle<CR>", { desc = "[D]iagnostic: Trouble [w]orkspace" })
|
||||
keymap.set("n", "<leader>dc", "<cmd>Trouble diagnostics toggle filter.buf=0<CR>", { desc = "[D]iagnostic: Trouble do[c]ument" })
|
||||
keymap.set("n", "<leader>dq", "<cmd>Trouble quickfix toggle<CR>", { desc = "[D]iagnostic: Trouble [q]uickfix" })
|
||||
|
||||
-- File [E]xplorer
|
||||
-- nvim-tree/nvim-tree.lua
|
||||
keymap.set("n", "<leader>ee", "<cmd>NvimTreeToggle<CR>", { desc = "File [E]xplorer: Toggle file [e]xplorer" })
|
||||
keymap.set("n", "<leader>ef", "<cmd>NvimTreeFindFileToggle<CR>", { desc = "File [E]xplorer: Toggle file explorer on current [f]ile" })
|
||||
keymap.set("n", "<leader>ec", "<cmd>NvimTreeCollapse<CR>", { desc = "File [E]xplorer: [C]ollapse" })
|
||||
keymap.set("n", "<leader>er", "<cmd>NvimTreeRefresh<CR>", { desc = "File [E]xplorer: [R]efresh" })
|
||||
|
||||
-- [F]ind
|
||||
-- nvim-telescope/telescope.nvim
|
||||
keymap.set("n", "<leader>ff", "<cmd>Telescope find_files<cr>", { desc = "[F]ind: [f]iles in cwd" })
|
||||
keymap.set("n", "<leader>fr", "<cmd>Telescope oldfiles<cr>", { desc = "[F]ind: [r]ecent files" })
|
||||
keymap.set("n", "<leader>fs", "<cmd>Telescope live_grep<cr>", { desc = "[F]ind: string in cwd" })
|
||||
keymap.set("n", "<leader>fc", "<cmd>Telescope grep_string<cr>", { desc = "[F]ind: string under [c]ursor in cwd" })
|
||||
-- folke/todo-comments.nvim
|
||||
keymap.set("n", "<leader>ft", "<cmd>TodoTelescope<cr>", { desc = "[F]ind: [t]odos" })
|
||||
-- folke/snacks.nvim
|
||||
keymap.set("n", "<leader>fq", function() Snacks.picker.qflist() end, { desc = "[F]ind: [Q]uickfix list" })
|
||||
|
||||
-- [G]it
|
||||
-- lewis6991/gitsigns.nvim
|
||||
keymap.set("n", "<leader>gs", "<cmd>Gitsigns stage_buffer<CR>", { desc = "[G]it: [s]tage buffer" })
|
||||
keymap.set("n", "<leader>gr", "<cmd>Gitsigns reset_buffer<CR>", { desc = "[G]it: [r]eset buffer" })
|
||||
keymap.set("n", "<leader>gb", "<cmd>Gitsigns blame_line<CR>", { desc = "[G]it: [b]lame line" })
|
||||
keymap.set("n", "<leader>gd", "<cmd>Gitsigns diffthis<CR>", { desc = "[G]it: [d]iff this" })
|
||||
keymap.set("n", "<leader>ghn", "<cmd>Gitsigns nav_hunk next<CR>", { desc = "[G]it [H]unk: [n]ext" })
|
||||
keymap.set("n", "<leader>ghp", "<cmd>Gitsigns nav_hunk prev<CR>", { desc = "[G]it [H]unk: [p]revious" })
|
||||
keymap.set("n", "<leader>ghs", "<cmd>Gitsigns stage_hunk<CR>", { desc = "[G]it [H]unk: [s]tage" })
|
||||
keymap.set("n", "<leader>ghr", "<cmd>Gitsigns reset_hunk<CR>", { desc = "[G]it [H]unk: [r]eset" })
|
||||
keymap.set("n", "<leader>ghv", "<cmd>Gitsigns preview_hunk<CR>", { desc = "[G]it [H]unk: pre[v]iew" })
|
||||
keymap.set("v", "<leader>ghs", function() require("gitsigns").stage_hunk({ vim.fn.line("."), vim.fn.line("v") }) end, { desc = "[G]it [H]unk: [s]tage" })
|
||||
keymap.set("v", "<leader>ghr", function() require("gitsigns").reset_hunk({ vim.fn.line("."), vim.fn.line("v") }) end, { desc = "[G]it [H]unk: [r]eset" })
|
||||
keymap.set({ "o", "x" }, "<leader>gh", "<cmd>Gitsigns select_hunk<CR>", { desc = "[G]it [H]unk: select" })
|
||||
|
||||
-- [H]istory
|
||||
-- folke/snacks.nvim
|
||||
keymap.set("n", "<leader>hn", function() Snacks.picker.notifications() end, { desc = "[H]istory: [N]otifications" } )
|
||||
keymap.set("n", "<leader>hc", function() Snacks.picker.command_history() end, { desc = "[H]istory: [C]ommands" } )
|
||||
|
||||
-- [L]SP
|
||||
-- folke/snacks.nvim
|
||||
keymap.set("n", "<leader>lf", function() Snacks.picker.lsp_definitions() end, { desc = "[L]SP: Goto De[f]initions" })
|
||||
keymap.set("n", "<leader>lc", function() Snacks.picker.lsp_declarations() end, { desc = "[L]SP: Goto De[c]larations" })
|
||||
keymap.set("n", "<leader>le", function() Snacks.picker.lsp_references() end, { desc = "[L]SP: Goto R[e]ferences" })
|
||||
keymap.set("n", "<leader>li", function() Snacks.picker.lsp_implementations() end, { desc = "[L]SP: Goto [I]mplementations" })
|
||||
keymap.set("n", "<leader>ly", function() Snacks.picker.lsp_type_definitions() end, { desc = "[L]SP: Goto T[y]pe Definitions" })
|
||||
|
||||
-- [P]anes
|
||||
keymap.set("n", "<leader>pv", "<C-w>v", { desc = "[P]ane: split [v]ertically" })
|
||||
keymap.set("n", "<leader>ph", "<C-w>s", { desc = "[P]ane: split [h]orizontally" })
|
||||
keymap.set("n", "<leader>pe", "<C-w>=", { desc = "[P]ane: Make splits [e]qual size" })
|
||||
keymap.set("n", "<leader>pc", "<cmd>close<CR>", { desc = "[P]ane: [C]lose current split" })
|
||||
-- szw/vim-maximizer
|
||||
keymap.set("n", "<leader>pm", "<cmd>MaximizerToggle<CR>", { desc = "[P]ane: [M]aximize/minimize current split" })
|
||||
|
||||
-- [S]ession
|
||||
-- rmagatti/auto-session
|
||||
keymap.set("n", "<leader>sr", "<cmd>AutoSession restore<CR>", { desc = "[S]ession: [R]estore" })
|
||||
keymap.set("n", "<leader>ss", "<cmd>AutoSession save<CR>", { desc = "[S]ession: [S]ave" })
|
||||
keymap.set("n", "<leader>sf", "<cmd>AutoSession search<CR>", { desc = "[S]ession: [F]ind" })
|
||||
keymap.set("n", "<leader>sd", "<cmd>AutoSession deletePicker<CR>", { desc = "[S]ession: [D]elete" })
|
||||
|
||||
-- [T]abs
|
||||
keymap.set("n", "<leader>to", "<cmd>tabnew<CR>", { desc = "[T]ab: Open new" })
|
||||
keymap.set("n", "<leader>tc", "<cmd>tabclose<CR>", { desc = "[T]ab: [C]lose current" })
|
||||
keymap.set("n", "<leader>tn", "<cmd>tabn<CR>", { desc = "[T]ab: Go to [n]ext" })
|
||||
keymap.set("n", "<leader>tp", "<cmd>tabp<CR>", { desc = "[T]ab: Go to [p]revious" })
|
||||
keymap.set("n", "<leader>tb", "<cmd>tabnew %<CR>", { desc = "[T]ab: Open current buffer in new tab" })
|
||||
|
||||
-- [U]I
|
||||
-- folke/snacks.nvim
|
||||
keymap.set("n", "<leader>ug", function() Snacks.lazygit() end, { desc = "[U]I: Open [L]azyGit" })
|
||||
keymap.set("n", "<leader>ud", function() Snacks.dashboard() end, { desc = "[U]I: Open [D]ashboard" })
|
||||
-- folke/lazy.nvim
|
||||
keymap.set("n", "<leader>ul", "<cmd>Lazy<CR>", { desc = "[U]I: Open [L]azyVim" })
|
||||
|
||||
-- Misc
|
||||
-- VonHeikemen/fine-cmdline.nvim
|
||||
keymap.set("n", ":", "<cmd>FineCmdline<CR>", { desc = "Fine Command Line" })
|
||||
-- folke/which-key.nvim
|
||||
keymap.set("n", "<leader>?", function() require("which-key").show({ global = false }) end, { desc = "Buffer Local Keymaps (which-key)" })
|
||||
29
nvim/lua/config/lazy.lua
Normal file
29
nvim/lua/config/lazy.lua
Normal file
@@ -0,0 +1,29 @@
|
||||
-- https://githup.com/folke/lazy.nvim
|
||||
-- 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)
|
||||
|
||||
-- Setup lazy.nvim
|
||||
require("lazy").setup("plugins", {
|
||||
checker = {
|
||||
enabled = true,
|
||||
notify = false,
|
||||
},
|
||||
change_detection = {
|
||||
notify = false,
|
||||
},
|
||||
})
|
||||
|
||||
30
nvim/lua/config/lsp.lua
Normal file
30
nvim/lua/config/lsp.lua
Normal file
@@ -0,0 +1,30 @@
|
||||
vim.lsp.enable({
|
||||
"gitlabcils",
|
||||
"luals",
|
||||
"terraformls",
|
||||
"yamlls"
|
||||
})
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_lines = true,
|
||||
-- virtual_text = true,
|
||||
underline = true,
|
||||
update_in_insert = false,
|
||||
severity_sort = true,
|
||||
float = {
|
||||
border = "rounded",
|
||||
source = true,
|
||||
},
|
||||
signs = {
|
||||
text = {
|
||||
[vim.diagnostic.severity.ERROR] = " ",
|
||||
[vim.diagnostic.severity.WARN] = " ",
|
||||
[vim.diagnostic.severity.INFO] = " ",
|
||||
[vim.diagnostic.severity.HINT] = " ",
|
||||
},
|
||||
numhl = {
|
||||
[vim.diagnostic.severity.ERROR] = "ErrorMsg",
|
||||
[vim.diagnostic.severity.WARN] = "WarningMsg",
|
||||
},
|
||||
},
|
||||
})
|
||||
47
nvim/lua/config/options.lua
Normal file
47
nvim/lua/config/options.lua
Normal file
@@ -0,0 +1,47 @@
|
||||
-- Explorer tree style
|
||||
vim.cmd("let g:netrw_liststyle = 3")
|
||||
|
||||
-- Theme
|
||||
|
||||
local opt = vim.opt
|
||||
|
||||
-- Show string numbers relative to cursor position
|
||||
opt.relativenumber = true
|
||||
-- Show string numper of cursor position
|
||||
opt.number = true
|
||||
|
||||
-- tabs & idents
|
||||
opt.tabstop = 2 -- 2 spaces for tab
|
||||
opt.shiftwidth = 2 -- 2 spaces for ident
|
||||
opt.expandtab = true -- expand tab to spaces
|
||||
opt.autoindent = true -- save indent when start new line
|
||||
|
||||
-- Wrap long strings to fit screen size
|
||||
opt.wrap = true
|
||||
|
||||
-- search
|
||||
opt.ignorecase = true -- ignore case
|
||||
opt.smartcase = true -- case-sensitive when mixed case in search
|
||||
|
||||
-- highlite line with cursor
|
||||
-- opt.cursorline = true
|
||||
|
||||
-- turn on terminal colors
|
||||
opt.termguicolors = true
|
||||
opt.background = "dark"
|
||||
opt.signcolumn = "yes"
|
||||
|
||||
-- backspace
|
||||
opt.backspace = "indent,eol,start" -- allow backspace on indent, end of line or insert mode start position
|
||||
|
||||
-- clipboard
|
||||
opt.clipboard:append("unnamedplus") -- use system clipboard as default register
|
||||
|
||||
-- split windows
|
||||
opt.splitright = true -- split vertical window to the right
|
||||
opt.splitbelow = true -- split horizontal window to the bottom
|
||||
|
||||
-- turn off swapfile
|
||||
opt.swapfile = false
|
||||
|
||||
-- opt.messagesopt = "wait:10000,history:50"
|
||||
12
nvim/lua/plugins/auto-session.lua
Normal file
12
nvim/lua/plugins/auto-session.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
-- https://github.com/rmagatti/auto-session
|
||||
return {
|
||||
"rmagatti/auto-session",
|
||||
config = function()
|
||||
local auto_session = require("auto-session")
|
||||
|
||||
auto_session.setup({
|
||||
auto_restore_enabled = false,
|
||||
auto_session_suppress_dirs = { "~/", "~/Downloads", "~/Documents", "~/Desktop/" },
|
||||
})
|
||||
end,
|
||||
}
|
||||
31
nvim/lua/plugins/autopairs.lua
Normal file
31
nvim/lua/plugins/autopairs.lua
Normal file
@@ -0,0 +1,31 @@
|
||||
-- https://github.com/windwp/nvim-autopairs
|
||||
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,
|
||||
}
|
||||
53
nvim/lua/plugins/blink.lua
Normal file
53
nvim/lua/plugins/blink.lua
Normal file
@@ -0,0 +1,53 @@
|
||||
return {
|
||||
'saghen/blink.cmp',
|
||||
-- optional: provides snippets for the snippet source
|
||||
dependencies = { 'rafamadriz/friendly-snippets' },
|
||||
|
||||
-- use a release tag to download pre-built binaries
|
||||
version = '1.*',
|
||||
-- AND/OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust
|
||||
-- build = 'cargo build --release',
|
||||
-- If you use nix, you can build from source using latest nightly rust with:
|
||||
-- build = 'nix run .#build-plugin',
|
||||
|
||||
---@module 'blink.cmp'
|
||||
---@type blink.cmp.Config
|
||||
opts = {
|
||||
-- 'default' (recommended) for mappings similar to built-in completions (C-y to accept)
|
||||
-- 'super-tab' for mappings similar to vscode (tab to accept)
|
||||
-- 'enter' for enter to accept
|
||||
-- 'none' for no mappings
|
||||
--
|
||||
-- All presets have the following mappings:
|
||||
-- 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 (if signature.enabled = true)
|
||||
--
|
||||
-- See :h blink-cmp-config-keymap for defining your own keymap
|
||||
keymap = { preset = 'default' },
|
||||
|
||||
appearance = {
|
||||
-- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
|
||||
-- Adjusts spacing to ensure icons are aligned
|
||||
nerd_font_variant = 'mono'
|
||||
},
|
||||
|
||||
-- (Default) Only show the documentation popup when manually triggered
|
||||
completion = { documentation = { auto_show = true } },
|
||||
|
||||
-- Default list of enabled providers defined so that you can extend it
|
||||
-- elsewhere in your config, without redefining it, due to `opts_extend`
|
||||
sources = {
|
||||
default = { 'lsp', 'path', 'snippets', 'buffer' },
|
||||
},
|
||||
|
||||
-- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
|
||||
-- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation,
|
||||
-- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`
|
||||
--
|
||||
-- See the fuzzy documentation for more information
|
||||
fuzzy = { implementation = "prefer_rust_with_warning" }
|
||||
},
|
||||
opts_extend = { "sources.default" }
|
||||
}
|
||||
12
nvim/lua/plugins/bufferline.lua
Normal file
12
nvim/lua/plugins/bufferline.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
-- https://github.com/akinsho/bufferline.nvim
|
||||
return {
|
||||
"akinsho/bufferline.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
version = "*",
|
||||
opts = {
|
||||
options = {
|
||||
mode = "tabs",
|
||||
separator_style = "slant",
|
||||
},
|
||||
},
|
||||
}
|
||||
14
nvim/lua/plugins/catpuccin.lua
Normal file
14
nvim/lua/plugins/catpuccin.lua
Normal file
@@ -0,0 +1,14 @@
|
||||
-- https://github.com/catppuccin/nvim
|
||||
-- Catpuccin theme for nvim
|
||||
return {
|
||||
"catppuccin/nvim",
|
||||
name = "catppuccin",
|
||||
priority = 1000,
|
||||
config = function()
|
||||
require("catppuccin").setup({
|
||||
flavour = "mocha",
|
||||
auto_integrations = true,
|
||||
})
|
||||
vim.cmd.colorscheme "catppuccin"
|
||||
end
|
||||
}
|
||||
20
nvim/lua/plugins/comment.lua
Normal file
20
nvim/lua/plugins/comment.lua
Normal file
@@ -0,0 +1,20 @@
|
||||
-- https://github.com/numToStr/Comment.nvim
|
||||
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,
|
||||
}
|
||||
5
nvim/lua/plugins/fine-cmdline.lua
Normal file
5
nvim/lua/plugins/fine-cmdline.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
-- https://github.com/VonHeikemen/fine-cmdline.nvim
|
||||
return {
|
||||
"VonHeikemen/fine-cmdline.nvim",
|
||||
dependencies = { "MunifTanjim/nui.nvim" },
|
||||
}
|
||||
14
nvim/lua/plugins/gitlab.lua
Normal file
14
nvim/lua/plugins/gitlab.lua
Normal file
@@ -0,0 +1,14 @@
|
||||
return {
|
||||
"harrisoncramer/gitlab.nvim",
|
||||
dependencies = {
|
||||
"MunifTanjim/nui.nvim",
|
||||
"nvim-lua/plenary.nvim",
|
||||
"sindrets/diffview.nvim",
|
||||
"stevearc/dressing.nvim", -- Recommended but not required. Better UI for pickers.
|
||||
"nvim-tree/nvim-web-devicons", -- Recommended but not required. Icons in discussion tree.
|
||||
},
|
||||
build = function () require("gitlab.server").build(true) end, -- Builds the Go binary
|
||||
config = function()
|
||||
require("gitlab").setup()
|
||||
end,
|
||||
}
|
||||
10
nvim/lua/plugins/gitsigns.lua
Normal file
10
nvim/lua/plugins/gitsigns.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
-- https://github.com/lewis6991/gitsigns.nvim
|
||||
return {
|
||||
"lewis6991/gitsigns.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
opts = {
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
},
|
||||
}
|
||||
4
nvim/lua/plugins/init.lua
Normal file
4
nvim/lua/plugins/init.lua
Normal file
@@ -0,0 +1,4 @@
|
||||
return {
|
||||
"nvim-lua/plenary.nvim", -- lua functions that many plugins use
|
||||
"christoomey/vim-tmux-navigator", -- tmux & split window navigation
|
||||
}
|
||||
28
nvim/lua/plugins/lualine.lua
Normal file
28
nvim/lua/plugins/lualine.lua
Normal file
@@ -0,0 +1,28 @@
|
||||
-- https://github.com/nvim-lualine/lualine.nvim
|
||||
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
|
||||
|
||||
-- configure lualine with modified theme
|
||||
lualine.setup({
|
||||
options = {
|
||||
theme = 'auto',
|
||||
},
|
||||
sections = {
|
||||
lualine_x = {
|
||||
{
|
||||
lazy_status.updates,
|
||||
cond = lazy_status.has_updates,
|
||||
color = { fg = "#ff9e64" },
|
||||
},
|
||||
{ "encoding" },
|
||||
{ "fileformat" },
|
||||
{ "filetype" },
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
49
nvim/lua/plugins/nvim-tree.lua
Normal file
49
nvim/lua/plugins/nvim-tree.lua
Normal file
@@ -0,0 +1,49 @@
|
||||
-- https://github.com/nvim-tree/nvim-tree.lua
|
||||
return {
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
dependencies = "nvim-tree/nvim-web-devicons",
|
||||
config = function()
|
||||
local nvimtree = require("nvim-tree")
|
||||
|
||||
-- recommended settings from nvim-tree documentation
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
nvimtree.setup({
|
||||
view = {
|
||||
width = 40,
|
||||
relativenumber = false,
|
||||
},
|
||||
-- change folder arrow icons
|
||||
renderer = {
|
||||
indent_markers = {
|
||||
enable = true,
|
||||
},
|
||||
icons = {
|
||||
glyphs = {
|
||||
folder = {
|
||||
arrow_closed = "", -- arrow when folder is closed
|
||||
arrow_open = "", -- arrow when folder is open
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
-- disable window_picker for
|
||||
-- explorer to work well with
|
||||
-- window splits
|
||||
actions = {
|
||||
open_file = {
|
||||
window_picker = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
filters = {
|
||||
custom = { ".DS_Store" },
|
||||
},
|
||||
git = {
|
||||
ignore = false,
|
||||
},
|
||||
})
|
||||
end
|
||||
}
|
||||
84
nvim/lua/plugins/snacks.lua
Normal file
84
nvim/lua/plugins/snacks.lua
Normal file
@@ -0,0 +1,84 @@
|
||||
return {
|
||||
"folke/snacks.nvim",
|
||||
priority = 1000,
|
||||
lazy = false,
|
||||
opts = {
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
indent = { enabled = true },
|
||||
input = { enabled = true },
|
||||
git = { enabled = true },
|
||||
lazygit = { enabled = true },
|
||||
notifier = { enabled = true },
|
||||
picker = { enabled = true },
|
||||
dashboard = {
|
||||
width = 80,
|
||||
row = nil, -- dashboard position. nil for center
|
||||
col = nil, -- dashboard position. nil for center
|
||||
pane_gap = 20, -- empty columns between vertical panes
|
||||
preset = {
|
||||
header = [[
|
||||
" *++*- "
|
||||
" -=+++++ "
|
||||
" -=====++= "
|
||||
" :======== "
|
||||
" .======== "
|
||||
" .-======= "
|
||||
" .----====. :---. "
|
||||
" -------. :===--- "
|
||||
" :----. :======-- "
|
||||
" :========. "
|
||||
" =======. "
|
||||
" ======++ "
|
||||
" .+++++++* "
|
||||
" .+++++** "
|
||||
" .***** "
|
||||
" "
|
||||
" "
|
||||
" "
|
||||
" =. "
|
||||
" -#%%=. :++++ :### .++++. "
|
||||
" .#####% -#### %%. .*### "
|
||||
" .:%##-:: .-==: :--: .::. %##- .:-==:. ###% :==. :==:. "
|
||||
" *%###%%# *##%###%.####. +### .##% .%##%%###. %##=%####. :#######. "
|
||||
" -### %##= .%#% ###. *### ###* .###. .### :###. -##% =##% .### "
|
||||
" %##+ :######%= +##% %##- %##: %### #### +######%. ######%*. "
|
||||
" .### :##% .. %##+ +### ###. %### .###: %##-.###. ###: - "
|
||||
" *### =######@ :######: :###% .####%####.:##% ####= .%#####% "
|
||||
" ###- "
|
||||
" *####% "
|
||||
" .:-:. "]],
|
||||
keys = {
|
||||
{ icon = " ", key = "n", desc = "New File", action = ":ene | startinsert" },
|
||||
{ icon = " ", key = "e", desc = "File Explorer", action = ":NvimTreeToggle" },
|
||||
{ icon = " ", key = "ff", desc = "Find File", action = ":Telescope find_files" },
|
||||
{ icon = " ", key = "fs", desc = "Find String", action = ":Telescope live_grep" },
|
||||
{ icon = " ", key = "s", desc = "Restore Session", action = ":AutoSession restore"},
|
||||
{ icon = " ", key = "L", desc = "Lazy UI", action = ":Lazy", enabled = package.loaded.lazy ~= nil },
|
||||
{ icon = " ", key = "G", desc = "LazyGit", action = function() Snacks.lazygit() end},
|
||||
{ icon = " ", key = "q", desc = "Quit", action = ":qa" },
|
||||
},
|
||||
},
|
||||
sections = {
|
||||
{ section = "header" },
|
||||
{
|
||||
pane = 2,
|
||||
icon = " ",
|
||||
title = "Git Status",
|
||||
section = "terminal",
|
||||
enabled = function()
|
||||
return Snacks.git.get_root() ~= nil
|
||||
end,
|
||||
cmd = "git status --short --branch --renames",
|
||||
height = 5,
|
||||
padding = 2,
|
||||
ttl = 5 * 60,
|
||||
indent = 3,
|
||||
},
|
||||
{ pane = 2, section = "keys", gap = 1, padding = 4 },
|
||||
{ pane = 2, section = "startup" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
4
nvim/lua/plugins/sops.lua
Normal file
4
nvim/lua/plugins/sops.lua
Normal file
@@ -0,0 +1,4 @@
|
||||
-- https://github.com/trixnz/sops.nvim
|
||||
return {
|
||||
"trixnz/sops.nvim",
|
||||
}
|
||||
10
nvim/lua/plugins/substitude.lua
Normal file
10
nvim/lua/plugins/substitude.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
-- https://github.com/gbprod/substitute.nvim
|
||||
return {
|
||||
-- "gbprod/substitute.nvim",
|
||||
-- event = { "BufReadPre", "BufNewFile" },
|
||||
-- opts = {
|
||||
-- -- your configuration comes here
|
||||
-- -- or leave it empty to use the default settings
|
||||
-- -- refer to the configuration section below
|
||||
-- }
|
||||
}
|
||||
7
nvim/lua/plugins/surround.lua
Normal file
7
nvim/lua/plugins/surround.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
-- https://github.com/kylechui/nvim-surround
|
||||
return {
|
||||
"kylechui/nvim-surround",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
version = "*", -- Use for stability; omit to use `main` branch for the latest features
|
||||
config = true,
|
||||
}
|
||||
30
nvim/lua/plugins/telescope.lua
Normal file
30
nvim/lua/plugins/telescope.lua
Normal file
@@ -0,0 +1,30 @@
|
||||
-- https://github.com/nvim-telescope/telescope.nvim
|
||||
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",
|
||||
},
|
||||
config = function()
|
||||
local telescope = require("telescope")
|
||||
local actions = require("telescope.actions")
|
||||
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
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, -- add to qflist
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
telescope.load_extension("fzf")
|
||||
end,
|
||||
}
|
||||
11
nvim/lua/plugins/todo-comments.lua
Normal file
11
nvim/lua/plugins/todo-comments.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
-- https://github.com/folke/todo-comments.nvim
|
||||
return {
|
||||
"folke/todo-comments.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
opts = {
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
}
|
||||
}
|
||||
55
nvim/lua/plugins/treesitter.lua
Normal file
55
nvim/lua/plugins/treesitter.lua
Normal file
@@ -0,0 +1,55 @@
|
||||
-- https://github.com/nvim-treesitter/nvim-treesitter
|
||||
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
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"dockerfile",
|
||||
"gitignore",
|
||||
"jinja",
|
||||
"jinja_inline",
|
||||
"json",
|
||||
"hcl",
|
||||
"helm",
|
||||
"lua",
|
||||
"luadoc",
|
||||
"luap",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"nginx",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"yaml",
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<C-space>",
|
||||
node_incremental = "<C-space>",
|
||||
scope_incremental = false,
|
||||
node_decremental = "<bs>",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
9
nvim/lua/plugins/trouble.lua
Normal file
9
nvim/lua/plugins/trouble.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
return {
|
||||
"folke/trouble.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons", "folke/todo-comments.nvim" },
|
||||
opts = {
|
||||
focus = true,
|
||||
auto_preview = false,
|
||||
},
|
||||
cmd = "Trouble",
|
||||
}
|
||||
5
nvim/lua/plugins/vim-maximizer.lua
Normal file
5
nvim/lua/plugins/vim-maximizer.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
-- https://github.com/szw/vim-maximizer
|
||||
return {
|
||||
"szw/vim-maximizer",
|
||||
event = "VeryLazy",
|
||||
}
|
||||
14
nvim/lua/plugins/which-key.lua
Normal file
14
nvim/lua/plugins/which-key.lua
Normal file
@@ -0,0 +1,14 @@
|
||||
-- https://github.com/folke/which-key.nvim
|
||||
return {
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
init = function()
|
||||
vim.o.timeout = true
|
||||
vim.o.timeoutlen = 500
|
||||
end,
|
||||
opts = {
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user