Add neovim config
This commit is contained in:
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