finally configured nvim myself

This commit is contained in:
doman 2023-08-29 20:07:23 +02:00
parent 8fc3233841
commit 141cc43651
20 changed files with 1212 additions and 1 deletions

View file

@ -34,5 +34,5 @@ alias kot="cd $KOT"
alias krd="cd $KRD" alias krd="cd $KRD"
alias neg="cd $NEG" alias neg="cd $NEG"
alias nego="cd $NEGO && source .venv/bin/activate && make" alias nego="cd $NEGO && source .venv/bin/activate && make"
alias negn="cd $NEGN" alias negn="cd $NEGN && source .venv/bin/activate"
alias negs="cd $NEGS" alias negs="cd $NEGS"

4
.config/nvim/init.lua Normal file
View file

@ -0,0 +1,4 @@
require("config.options")
require("config.lazy")
require("config.keymaps")
require("config.autocmds")

View file

@ -0,0 +1,56 @@
{
"workspace.library": [
"/Users/doman/.local/share/nvim/lazy/neodev.nvim/types/stable",
"/opt/homebrew/Cellar/neovim/0.9.1/share/nvim/runtime/lua",
"/Users/doman/.local/share/nvim/lazy/trouble.nvim/lua",
"/Users/doman/.local/share/nvim/lazy/mini.ai/lua",
"/Users/doman/.local/share/nvim/lazy/todo-comments.nvim/lua",
"/Users/doman/.local/share/nvim/lazy/indent-blankline.nvim/lua",
"/Users/doman/.local/share/nvim/lazy/catppuccin/lua",
"/Users/doman/.local/share/nvim/lazy/mason-lspconfig.nvim/lua",
"/Users/doman/.local/share/nvim/lazy/nvim-treesitter/lua",
"/Users/doman/.local/share/nvim/lazy/mason.nvim/lua",
"/Users/doman/.local/share/nvim/lazy/mini.bufremove/lua",
"/Users/doman/.local/share/nvim/lazy/bufferline.nvim/lua",
"/Users/doman/.local/share/nvim/lazy/neo-tree.nvim/lua",
"/Users/doman/.local/share/nvim/lazy/lazy.nvim/lua",
"/Users/doman/.local/share/nvim/lazy/neoconf.nvim/lua",
"/Users/doman/.local/share/nvim/lazy/persistence.nvim/lua",
"/Users/doman/.local/share/nvim/lazy/neodev.nvim/lua",
"/Users/doman/.local/share/nvim/lazy/vim-startuptime/lua",
"/Users/doman/.local/share/nvim/lazy/nui.nvim/lua",
"/Users/doman/.local/share/nvim/lazy/telescope.nvim/lua",
"/Users/doman/.local/share/nvim/lazy/alpha-nvim/lua",
"/Users/doman/.local/share/nvim/lazy/nvim-web-devicons/lua",
"/Users/doman/.local/share/nvim/lazy/null-ls.nvim/lua",
"/Users/doman/.local/share/nvim/lazy/LuaSnip/lua",
"/Users/doman/.local/share/nvim/lazy/nvim-navic/lua",
"/Users/doman/.local/share/nvim/lazy/noice.nvim/lua",
"/Users/doman/.local/share/nvim/lazy/nvim-cmp/lua",
"/Users/doman/.local/share/nvim/lazy/mini.comment/lua",
"/Users/doman/.local/share/nvim/lazy/mini.surround/lua",
"/Users/doman/.local/share/nvim/lazy/tokyonight.nvim/lua",
"/Users/doman/.local/share/nvim/lazy/LazyVim/lua",
"/Users/doman/.local/share/nvim/lazy/mini.indentscope/lua",
"/Users/doman/.local/share/nvim/lazy/lualine.nvim/lua",
"/Users/doman/.local/share/nvim/lazy/mini.pairs/lua",
"/Users/doman/.local/share/nvim/lazy/cmp-nvim-lsp/lua",
"/Users/doman/.local/share/nvim/lazy/which-key.nvim/lua",
"/Users/doman/.local/share/nvim/lazy/cmp-path/lua",
"/Users/doman/.local/share/nvim/lazy/nvim-treesitter-textobjects/lua",
"/Users/doman/.local/share/nvim/lazy/nvim-lspconfig/lua",
"/Users/doman/.local/share/nvim/lazy/cmp_luasnip/lua",
"/Users/doman/.local/share/nvim/lazy/nvim-notify/lua",
"/Users/doman/.local/share/nvim/lazy/flash.nvim/lua",
"/Users/doman/.local/share/nvim/lazy/vim-illuminate/lua",
"/Users/doman/.local/share/nvim/lazy/dressing.nvim/lua",
"/Users/doman/.local/share/nvim/lazy/nvim-spectre/lua",
"/Users/doman/.local/share/nvim/lazy/cmp-buffer/lua",
"/Users/doman/.local/share/nvim/lazy/nvim-ts-context-commentstring/lua",
"/Users/doman/.local/share/nvim/lazy/gitsigns.nvim/lua",
"/Users/doman/.local/share/nvim/lazy/plenary.nvim/lua",
"/Users/doman/.config/nvim/lua",
"/Users/doman/.local/share/nvim/mason/packages/lua-language-server/libexec/meta/32f52be3",
"/Users/doman/.local/share/nvim/mason/packages/lua-language-server/libexec/meta/1480a74c"
]
}

View file

View file

@ -0,0 +1,121 @@
vim.api.nvim_set_keymap("n", "<leader>j", "<cmd>bprev<cr>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader>k", "<cmd>bnext<cr>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("x", "<C-p>", '"_dP', { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader>/", "gcc", { noremap = false, silent = true })
vim.api.nvim_set_keymap(
"v",
"<leader>/",
"<esc><cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<cr>",
{ noremap = true, silent = true }
)
-- Move to window using the <ctrl> hjkl keys
vim.keymap.set("n", "<C-h>", "<C-w>h", { desc = "Go to left window", remap = true })
vim.keymap.set("n", "<C-j>", "<C-w>j", { desc = "Go to lower window", remap = true })
vim.keymap.set("n", "<C-k>", "<C-w>k", { desc = "Go to upper window", remap = true })
vim.keymap.set("n", "<C-l>", "<C-w>l", { desc = "Go to right window", remap = true })
-- Resize window using <ctrl> arrow keys
vim.keymap.set("n", "<C-Up>", "<cmd>resize +2<cr>", { desc = "Increase window height" })
vim.keymap.set("n", "<C-Down>", "<cmd>resize -2<cr>", { desc = "Decrease window height" })
vim.keymap.set("n", "<C-Left>", "<cmd>vertical resize -2<cr>", { desc = "Decrease window width" })
vim.keymap.set("n", "<C-Right>", "<cmd>vertical resize +2<cr>", { desc = "Increase window width" })
vim.keymap.set("n", "<leader>bb", "<cmd>e #<cr>", { desc = "Switch to Other Buffer" })
vim.keymap.set("n", "<leader>`", "<cmd>e #<cr>", { desc = "Switch to Other Buffer" })
-- Clear search with <esc>
vim.keymap.set({ "i", "n" }, "<esc>", "<cmd>noh<cr><esc>", { desc = "Escape and clear hlsearch" })
-- Clear search, diff update and redraw
-- taken from runtime/lua/_editor.lua
vim.keymap.set(
"n",
"<leader>ur",
"<Cmd>nohlsearch<Bar>diffupdate<Bar>normal! <C-L><CR>",
{ desc = "Redraw / clear hlsearch / diff update" }
)
vim.keymap.set({ "n", "x" }, "gw", "*N", { desc = "Search word under cursor" })
-- https://github.com/mhinz/vim-galore#saner-behavior-of-n-and-n
vim.keymap.set("n", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" })
vim.keymap.set("x", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" })
vim.keymap.set("o", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" })
vim.keymap.set("n", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" })
vim.keymap.set("x", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" })
vim.keymap.set("o", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" })
-- Add undo break-points
vim.keymap.set("i", ",", ",<c-g>u")
vim.keymap.set("i", ".", ".<c-g>u")
vim.keymap.set("i", ";", ";<c-g>u")
-- save file
vim.keymap.set({ "i", "v", "n", "s" }, "<C-s>", "<cmd>w<cr><esc>", { desc = "Save file" })
--keywordprg
vim.keymap.set("n", "<leader>K", "<cmd>norm! K<cr>", { desc = "Keywordprg" })
-- better indenting
vim.keymap.set("v", "<", "<gv")
vim.keymap.set("v", ">", ">gv")
-- lazy
vim.keymap.set("n", "<leader>l", "<cmd>Lazy<cr>", { desc = "Lazy" })
-- new file
vim.keymap.set("n", "<leader>fn", "<cmd>enew<cr>", { desc = "New File" })
vim.keymap.set("n", "<leader>xl", "<cmd>lopen<cr>", { desc = "Location List" })
vim.keymap.set("n", "<leader>xq", "<cmd>copen<cr>", { desc = "Quickfix List" })
vim.keymap.set("n", "[q", vim.cmd.cprev, { desc = "Previous quickfix" })
-- highlights under cursor
if vim.fn.has("nvim-0.9.0") == 1 then
vim.keymap.set("n", "<leader>ui", vim.show_pos, { desc = "Inspect Pos" })
end
-- Terminal vim.keymap.setpings
vim.keymap.set("t", "<esc><esc>", "<c-\\><c-n>", { desc = "Enter Normal Mode" })
vim.keymap.set("t", "<C-h>", "<cmd>wincmd h<cr>", { desc = "Go to left window" })
vim.keymap.set("t", "<C-j>", "<cmd>wincmd j<cr>", { desc = "Go to lower window" })
vim.keymap.set("t", "<C-k>", "<cmd>wincmd k<cr>", { desc = "Go to upper window" })
vim.keymap.set("t", "<C-l>", "<cmd>wincmd l<cr>", { desc = "Go to right window" })
vim.keymap.set("t", "<C-/>", "<cmd>close<cr>", { desc = "Hide Terminal" })
vim.keymap.set("t", "<c-_>", "<cmd>close<cr>", { desc = "which_key_ignore" })
-- windows
vim.keymap.set("n", "<leader>ww", "<C-W>p", { desc = "Other window", remap = true })
vim.keymap.set("n", "<leader>wd", "<C-W>c", { desc = "Delete window", remap = true })
vim.keymap.set("n", "<leader>w-", "<C-W>s", { desc = "Split window below", remap = true })
vim.keymap.set("n", "<leader>w|", "<C-W>v", { desc = "Split window right", remap = true })
vim.keymap.set("n", "<leader>-", "<C-W>s", { desc = "Split window below", remap = true })
vim.keymap.set("n", "<leader>|", "<C-W>v", { desc = "Split window right", remap = true })
-- tabs
vim.keymap.set("n", "<leader><tab>l", "<cmd>tablast<cr>", { desc = "Last Tab" })
vim.keymap.set("n", "<leader><tab>f", "<cmd>tabfirst<cr>", { desc = "First Tab" })
vim.keymap.set("n", "<leader><tab><tab>", "<cmd>tabnew<cr>", { desc = "New Tab" })
vim.keymap.set("n", "<leader><tab>]", "<cmd>tabnext<cr>", { desc = "Next Tab" })
vim.keymap.set("n", "<leader><tab>d", "<cmd>tabclose<cr>", { desc = "Close Tab" })
vim.keymap.set("n", "<leader><tab>[", "<cmd>tabprevious<cr>", { desc = "Previous Tab" })
-- lsp
vim.keymap.set("n", "gd", "<cmd>lua vim.lsp.buf.definition()<cr>", { desc = "Goto Definition" })
vim.keymap.set("n", "gs", "<cmd>vsplit | lua vim.lsp.buf.definition()<cr>", { desc = "Goto Definition in vertical split" })
vim.keymap.set("n", "gS", "<cmd>belowright | lua vim.lsp.buf.definition()<cr>", { desc = "Goto Definition in horizontal split" })
vim.keymap.set("n", "gD", "<cmd>lua vim.lsp.buf.declaration()<cr>", { desc = "Goto Declaration" })
vim.keymap.set("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<cr>", { desc = "Goto Implementation" })
vim.keymap.set("n", "gr", "<cmd>lua vim.lsp.buf.references()<cr>", { desc = "Goto References" })
vim.keymap.set("n", "K", "<cmd>lua vim.lsp.buf.hover()<cr>", { desc = "Hover" })
vim.keymap.set("n", "<leader>ld", vim.diagnostic.open_float, { desc = "Line Diagnostics" })
vim.keymap.set("n", "<leader>ll", "<cmd>LspInfo<cr>", { desc = "Lsp Info" })
vim.keymap.set("n", "<leader>lf", vim.lsp.buf.format, { desc = "Format document" })
vim.keymap.set("n", "<leader>la", "<cmd>lua vim.lsp.buf.code_action()<CR>", { desc = "Code actions" })
vim.keymap.set("n", "<leader>lr", "<cmd>lua vim.lsp.buf.rename()<CR>", { desc = "Rename" })
-- colorizer
vim.keymap.set("n", "<leader>cs", "<cmd>ColorizerToggle<CR>", { desc = "Toggle show colors" })

View file

@ -0,0 +1,14 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
-- bootstrap lazy.nvim
-- stylua: ignore
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
end
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
require("lazy").setup({
spec = {
{ import = "plugins" },
},
checker = { enabled = true },
})

View file

@ -0,0 +1,58 @@
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"
vim.g.autoformat_enabled = true
vim.g.cmp_enabled = true
vim.g.icons_enabled = true
local opt = vim.opt
opt.autowrite = true -- Enable auto write
opt.clipboard = "unnamedplus" -- Sync with system clipboard
opt.completeopt = "menu,menuone,noselect"
opt.conceallevel = 3 -- Hide * markup for bold and italic
opt.confirm = true -- Confirm to save changes before exiting modified buffer
opt.cursorline = true -- Enable highlighting of the current line
opt.expandtab = true -- Use spaces instead of tabs
opt.formatoptions = "jcroqlnt" -- tcqj
opt.grepformat = "%f:%l:%c:%m"
opt.grepprg = "rg --vimgrep"
opt.ignorecase = true -- Ignore case
opt.inccommand = "nosplit" -- preview incremental substitute
opt.laststatus = 0
opt.list = true -- Show some invisible characters (tabs...
opt.mouse = "a" -- Enable mouse mode
opt.number = true -- Print line number
opt.pumblend = 10 -- Popup blend
opt.pumheight = 10 -- Maximum number of entries in a popup
opt.relativenumber = true -- Relative line numbers
opt.scrolloff = 4 -- Lines of context
opt.sessionoptions = { "buffers", "curdir", "tabpages", "winsize" }
opt.shiftround = true -- Round indent
opt.shiftwidth = 2 -- Size of an indent
opt.shortmess:append({ W = true, I = true, c = true })
opt.showmode = false -- Dont show mode since we have a statusline
opt.sidescrolloff = 8 -- Columns of context
opt.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time
opt.smartcase = true -- Don't ignore case with capitals
opt.smartindent = true -- Insert indents automatically
opt.spell = true
opt.spelllang = { "en_us,pl" }
opt.splitbelow = true -- Put new windows below current
opt.splitright = true -- Put new windows right of current
opt.tabstop = 2 -- Number of spaces tabs count for
opt.termguicolors = true -- True color support
opt.timeoutlen = 300
opt.undofile = true
opt.undolevels = 10000
opt.updatetime = 200 -- Save swap file and trigger CursorHold
opt.wildmode = "longest:full,full" -- Command-line completion mode
opt.winminwidth = 5 -- Minimum window width
opt.wrap = false -- Disable line wrap
if vim.fn.has("nvim-0.9.0") == 1 then
opt.splitkeep = "screen"
opt.shortmess:append({ C = true })
end
-- Fix markdown indentation settings
vim.g.markdown_recommended_style = 0

View file

@ -0,0 +1,7 @@
return {
{
"numToStr/Comment.nvim",
opts = {},
lazy = false,
},
}

View file

@ -0,0 +1,52 @@
return {
{
"zbirenbaum/copilot.lua",
cmd = "Copilot",
event = "InsertEnter",
config = function()
require("copilot").setup({
panel = {
enabled = true,
auto_refresh = false,
keymap = {
jump_prev = "[[",
jump_next = "]]",
accept = "<C-a>",
refresh = "<C-r>",
open = "<C-w>",
},
layout = {
position = "bottom", -- | top | left | right
ratio = 0.4,
},
},
suggestion = {
enabled = true,
auto_trigger = true,
debounce = 80,
keymap = {
accept = "<C-a>",
accept_word = false,
accept_line = false,
next = "<C-q>",
prev = "<C-e>",
dismiss = "<C-d>",
},
},
filetypes = {
yaml = false,
markdown = false,
help = false,
gitcommit = false,
gitrebase = false,
hgcommit = false,
svn = false,
cvs = false,
["."] = false,
},
copilot_node_command = "node", -- Node.js version must be > 16.x
server_opts_overrides = {},
})
end,
},
}

View file

@ -0,0 +1,37 @@
return {
{
"lewis6991/gitsigns.nvim",
event = { "BufReadPre", "BufNewFile" },
opts = {
signs = {
add = { text = "" },
change = { text = "" },
delete = { text = "" },
topdelete = { text = "" },
changedelete = { text = "" },
untracked = { text = "" },
},
on_attach = function(buffer)
local gs = package.loaded.gitsigns
local function map(mode, l, r, desc)
vim.keymap.set(mode, l, r, { buffer = buffer, desc = desc })
end
-- stylua: ignore start
map("n", "]h", gs.next_hunk, "Next Hunk")
map("n", "[h", gs.prev_hunk, "Prev Hunk")
map({ "n", "v" }, "<leader>ghs", ":Gitsigns stage_hunk<CR>", "Stage Hunk")
map({ "n", "v" }, "<leader>ghr", ":Gitsigns reset_hunk<CR>", "Reset Hunk")
map("n", "<leader>ghS", gs.stage_buffer, "Stage Buffer")
map("n", "<leader>ghu", gs.undo_stage_hunk, "Undo Stage Hunk")
map("n", "<leader>ghR", gs.reset_buffer, "Reset Buffer")
map("n", "<leader>ghp", gs.preview_hunk, "Preview Hunk")
map("n", "<leader>ghb", function() gs.blame_line({ full = true }) end, "Blame Line")
map("n", "<leader>ghd", gs.diffthis, "Diff This")
map("n", "<leader>ghD", function() gs.diffthis("~") end, "Diff This ~")
map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>", "GitSigns Select Hunk")
end,
},
},
}

View file

@ -0,0 +1,54 @@
return {
{
"VonHeikemen/lsp-zero.nvim",
branch = "v2.x",
lazy = true,
config = function()
require("lsp-zero.settings").preset({})
end,
},
{
"hrsh7th/nvim-cmp",
event = "InsertEnter",
dependencies = {
{ "L3MON4D3/LuaSnip" },
},
config = function()
require("lsp-zero.cmp").extend()
local cmp = require("cmp")
local cmp_action = require("lsp-zero.cmp").action()
cmp.setup({
mapping = {
["<C-Space>"] = cmp.mapping.complete(),
["<C-f>"] = cmp_action.luasnip_jump_forward(),
["<C-b>"] = cmp_action.luasnip_jump_backward(),
['<Tab>'] = cmp.mapping.confirm({ select = true }),
},
})
end,
},
-- LSP
{
"neovim/nvim-lspconfig",
cmd = "LspInfo",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
{ "hrsh7th/cmp-nvim-lsp" },
{ "williamboman/mason-lspconfig.nvim" },
{ "williamboman/mason.nvim" },
},
config = function()
local lsp = require("lsp-zero")
lsp.on_attach(function(client, bufnr)
lsp.default_keymaps({ buffer = bufnr })
end)
require("lspconfig").lua_ls.setup(lsp.nvim_lua_ls())
lsp.setup()
end,
},
}

View file

@ -0,0 +1,317 @@
return {
{
"nvim-neo-tree/neo-tree.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
"MunifTanjim/nui.nvim",
{
's1n7ax/nvim-window-picker',
name = 'window-picker',
event = 'VeryLazy',
version = '2.*',
config = function()
require 'window-picker'.setup()
end,
}
},
lazy = false,
keys = {
{
"<leader>fe",
function()
require("neo-tree.command").execute({ toggle = true, dir = vim.loop.cwd() })
end,
desc = "Explorer NeoTree (cwd)",
},
{ "<leader>e", "<leader>fe", desc = "Explorer NeoTree", remap = true },
},
deactivate = function()
vim.cmd([[Neotree close]])
end,
init = function()
if vim.fn.argc() == 1 then
local stat = vim.loop.fs_stat(vim.fn.argv(0))
if stat and stat.type == "directory" then
require("neo-tree")
end
end
end,
config = function()
-- If you want icons for diagnostic errors, you'll need to define them somewhere:
vim.fn.sign_define("DiagnosticSignError", { text = "", texthl = "DiagnosticSignError" })
vim.fn.sign_define("DiagnosticSignWarn", { text = "", texthl = "DiagnosticSignWarn" })
vim.fn.sign_define("DiagnosticSignInfo", { text = "", texthl = "DiagnosticSignInfo" })
vim.fn.sign_define("DiagnosticSignHint", { text = "󰌵", texthl = "DiagnosticSignHint" })
require("neo-tree").setup({
close_if_last_window = true, -- Close Neo-tree if it is the last window left in the tab
popup_border_style = "rounded",
enable_git_status = true,
enable_diagnostics = true,
enable_normal_mode_for_inputs = false, -- Enable normal mode for input dialogs.
open_files_do_not_replace_types = { "terminal", "trouble", "qf" }, -- when opening files, do not use windows containing these filetypes or buftypes
sort_case_insensitive = false, -- used when sorting files and directories in the tree
sort_function = nil, -- use a custom function for sorting files and directories in the tree
-- sort_function = function (a,b)
-- if a.type == b.type then
-- return a.path > b.path
-- else
-- return a.type > b.type
-- end
-- end , -- this sorts files and directories descendantly
default_component_configs = {
container = {
enable_character_fade = true,
},
indent = {
indent_size = 2,
padding = 1, -- extra padding on left hand side
-- indent guides
with_markers = true,
indent_marker = "",
last_indent_marker = "",
highlight = "NeoTreeIndentMarker",
-- expander config, needed for nesting files
with_expanders = nil, -- if nil and file nesting is enabled, will enable expanders
expander_collapsed = "",
expander_expanded = "",
expander_highlight = "NeoTreeExpander",
},
icon = {
folder_closed = "",
folder_open = "",
folder_empty = "󰜌",
-- The next two settings are only a fallback, if you use nvim-web-devicons and configure default icons there
-- then these will never be used.
default = "*",
highlight = "NeoTreeFileIcon",
},
modified = {
symbol = "[+]",
highlight = "NeoTreeModified",
},
name = {
trailing_slash = false,
use_git_status_colors = true,
highlight = "NeoTreeFileName",
},
git_status = {
symbols = {
-- Change type
added = "", -- or "✚", but this is redundant info if you use git_status_colors on the name
modified = "", -- or "", but this is redundant info if you use git_status_colors on the name
deleted = "", -- this can only be used in the git_status source
renamed = "󰁕", -- this can only be used in the git_status source
-- Status type
untracked = "",
ignored = "",
unstaged = "󰄱",
staged = "",
conflict = "",
},
},
-- If you don't want to use these columns, you can set `enabled = false` for each of them individually
file_size = {
enabled = true,
required_width = 64, -- min width of window required to show this column
},
type = {
enabled = true,
required_width = 122, -- min width of window required to show this column
},
last_modified = {
enabled = true,
required_width = 88, -- min width of window required to show this column
},
created = {
enabled = true,
required_width = 110, -- min width of window required to show this column
},
symlink_target = {
enabled = false,
},
},
-- A list of functions, each representing a global custom command
-- that will be available in all sources (if not overridden in `opts[source_name].commands`)
-- see `:h neo-tree-custom-commands-global`
commands = {},
window = {
position = "left",
width = 40,
mapping_options = {
noremap = true,
nowait = true,
},
mappings = {
["<space>"] = {
"toggle_node",
nowait = false, -- disable `nowait` if you have existing combos starting with this char that you want to use
},
["<2-LeftMouse>"] = "open",
["o"] = "open",
["<esc>"] = "cancel", -- close preview or floating neo-tree window
["P"] = { "toggle_preview", config = { use_float = true } },
["l"] = "focus_preview",
-- ["S"] = "open_split",
-- ["s"] = "open_vsplit",
["S"] = "split_with_window_picker",
["s"] = "vsplit_with_window_picker",
-- ["t"] = "open_tabnew",
-- ["t"] = "open_drop",
-- ["t"] = "open_tab_drop",
["w"] = "open_with_window_picker",
--["P"] = "toggle_preview", -- enter preview mode, which shows the current node without focusing
["C"] = "close_node",
-- ['C'] = 'close_all_subnodes',
["z"] = "close_all_nodes",
--["Z"] = "expand_all_nodes",
["a"] = {
"add",
-- this command supports BASH style brace expansion ("x{a,b,c}" -> xa,xb,xc). see `:h neo-tree-file-actions` for details
-- some commands may take optional config options, see `:h neo-tree-mappings` for details
config = {
show_path = "none", -- "none", "relative", "absolute"
},
},
["A"] = "add_directory", -- also accepts the optional config.show_path option like "add". this also supports BASH style brace expansion.
["d"] = "delete",
["r"] = "rename",
["y"] = "copy_to_clipboard",
["x"] = "cut_to_clipboard",
["p"] = "paste_from_clipboard",
["c"] = "copy", -- takes text input for destination, also accepts the optional config.show_path option like "add":
-- ["c"] = {
-- "copy",
-- config = {
-- show_path = "none" -- "none", "relative", "absolute"
-- }
--}
["m"] = "move", -- takes text input for destination, also accepts the optional config.show_path option like "add".
["q"] = "close_window",
["R"] = "refresh",
["?"] = "show_help",
["<"] = "prev_source",
[">"] = "next_source",
["i"] = "show_file_details",
},
},
nesting_rules = {},
filesystem = {
filtered_items = {
visible = false, -- when true, they will just be displayed differently than normal items
hide_dotfiles = true,
hide_gitignored = true,
hide_hidden = true, -- only works on Windows for hidden files/directories
hide_by_name = {
--"node_modules"
},
hide_by_pattern = { -- uses glob style patterns
--"*.meta",
--"*/src/*/tsconfig.json",
},
always_show = { -- remains visible even if other settings would normally hide it
--".gitignored",
},
never_show = { -- remains hidden even if visible is toggled to true, this overrides always_show
--".DS_Store",
--"thumbs.db"
},
never_show_by_pattern = { -- uses glob style patterns
--".null-ls_*",
},
},
follow_current_file = {
enabled = false, -- This will find and focus the file in the active buffer every time
-- -- the current file is changed while the tree is open.
leave_dirs_open = false, -- `false` closes auto expanded dirs, such as with `:Neotree reveal`
},
group_empty_dirs = false, -- when true, empty folders will be grouped together
hijack_netrw_behavior = "open_default", -- netrw disabled, opening a directory opens neo-tree
-- in whatever position is specified in window.position
-- "open_current", -- netrw disabled, opening a directory opens within the
-- window like netrw would, regardless of window.position
-- "disabled", -- netrw left alone, neo-tree does not handle opening dirs
use_libuv_file_watcher = false, -- This will use the OS level file watchers to detect changes
-- instead of relying on nvim autocmd events.
window = {
mappings = {
["<bs>"] = "navigate_up",
["."] = "set_root",
["H"] = "toggle_hidden",
["/"] = "fuzzy_finder",
["D"] = "fuzzy_finder_directory",
["#"] = "fuzzy_sorter", -- fuzzy sorting using the fzy algorithm
-- ["D"] = "fuzzy_sorter_directory",
["f"] = "filter_on_submit",
["<c-x>"] = "clear_filter",
["[g"] = "prev_git_modified",
["]g"] = "next_git_modified",
["oc"] = { "order_by_created", nowait = false },
["od"] = { "order_by_diagnostics", nowait = false },
["og"] = { "order_by_git_status", nowait = false },
["om"] = { "order_by_modified", nowait = false },
["on"] = { "order_by_name", nowait = false },
["os"] = { "order_by_size", nowait = false },
["ot"] = { "order_by_type", nowait = false },
},
fuzzy_finder_mappings = { -- define keymaps for filter popup window in fuzzy_finder_mode
["<down>"] = "move_cursor_down",
["<C-n>"] = "move_cursor_down",
["<up>"] = "move_cursor_up",
["<C-p>"] = "move_cursor_up",
},
},
commands = {}, -- Add a custom command or override a global one using the same function name
},
buffers = {
follow_current_file = {
enabled = true, -- This will find and focus the file in the active buffer every time
-- -- the current file is changed while the tree is open.
leave_dirs_open = false, -- `false` closes auto expanded dirs, such as with `:Neotree reveal`
},
group_empty_dirs = true, -- when true, empty folders will be grouped together
show_unloaded = true,
window = {
mappings = {
["bd"] = "buffer_delete",
["<bs>"] = "navigate_up",
["."] = "set_root",
["o"] = { "show_help", nowait = false, config = { title = "Order by", prefix_key = "o" } },
["oc"] = { "order_by_created", nowait = false },
["od"] = { "order_by_diagnostics", nowait = false },
["om"] = { "order_by_modified", nowait = false },
["on"] = { "order_by_name", nowait = false },
["os"] = { "order_by_size", nowait = false },
["ot"] = { "order_by_type", nowait = false },
},
},
},
git_status = {
window = {
position = "float",
mappings = {
["A"] = "git_add_all",
["gu"] = "git_unstage_file",
["ga"] = "git_add_file",
["gr"] = "git_revert_file",
["gc"] = "git_commit",
["gp"] = "git_push",
["gg"] = "git_commit_and_push",
["o"] = { "show_help", nowait = false, config = { title = "Order by", prefix_key = "o" } },
["oc"] = { "order_by_created", nowait = false },
["od"] = { "order_by_diagnostics", nowait = false },
["om"] = { "order_by_modified", nowait = false },
["on"] = { "order_by_name", nowait = false },
["os"] = { "order_by_size", nowait = false },
["ot"] = { "order_by_type", nowait = false },
},
},
},
})
vim.cmd([[nnoremap \ :Neotree reveal<cr>]])
end,
},
}

View file

@ -0,0 +1,8 @@
return {
{
"simrat39/symbols-outline.nvim",
cmd = "SymbolsOutline",
keys = { { "<leader>ls", "<cmd>SymbolsOutline<cr>", desc = "Symbols Outline" } },
config = true,
},
}

View file

@ -0,0 +1,39 @@
return {
{
"nvim-telescope/telescope.nvim",
keys = {
{
"<leader>ff",
function()
require("telescope.builtin").find_files()
end,
desc = "Find Plugin File",
},
{
"<leader>fw",
function()
require("telescope.builtin").live_grep()
end,
desc = "Find File",
},
},
opts = {
defaults = {
layout_strategy = "horizontal",
layout_config = { prompt_position = "top" },
sorting_strategy = "ascending",
winblend = 0,
},
},
},
{
"telescope.nvim",
dependencies = {
"nvim-telescope/telescope-fzf-native.nvim",
build = "make",
config = function()
require("telescope").load_extension("fzf")
end,
},
},
}

View file

@ -0,0 +1,14 @@
return {
{
"RRethy/nvim-base16",
name = "nvim-base16",
lazy = false,
priority = 1000,
config = function()
vim.cmd.colorscheme "base16-ocean"
end,
},
{
"norcalli/nvim-colorizer.lua",
},
}

View file

@ -0,0 +1,13 @@
return {
{
"folke/todo-comments.nvim",
cmd = { "TodoTrouble", "TodoTelescope" },
event = { "BufReadPost", "BufNewFile" },
config = true,
-- stylua: ignore
keys = {
{ "]t", function() require("todo-comments").jump_next() end, desc = "Next todo comment" },
{ "[t", function() require("todo-comments").jump_prev() end, desc = "Previous todo comment" },
},
},
}

View file

@ -0,0 +1,86 @@
return {
{
"nvim-treesitter/nvim-treesitter",
version = false, -- last release is way too old and doesn't work on Windows
build = ":TSUpdate",
event = { "BufReadPost", "BufNewFile" },
dependencies = {
{
"nvim-treesitter/nvim-treesitter-textobjects",
init = function()
-- disable rtp plugin, as we only need its queries for mini.ai
-- In case other textobject modules are enabled, we will load them
-- once nvim-treesitter is loaded
require("lazy.core.loader").disable_rtp_plugin("nvim-treesitter-textobjects")
load_textobjects = true
end,
},
},
cmd = { "TSUpdateSync" },
keys = {
{ "<c-space>", desc = "Increment selection" },
{ "<bs>", desc = "Decrement selection", mode = "x" },
},
opts = {
highlight = { enable = true },
indent = { enable = true },
ensure_installed = {
"bash",
"c",
"html",
"javascript",
"jsdoc",
"json",
"lua",
"luadoc",
"luap",
"markdown",
"markdown_inline",
"python",
"query",
"regex",
"tsx",
"typescript",
"vim",
"vimdoc",
"yaml",
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<C-space>",
node_incremental = "<C-space>",
scope_incremental = false,
node_decremental = "<bs>",
},
},
},
config = function(_, opts)
if type(opts.ensure_installed) == "table" then
local added = {}
opts.ensure_installed = vim.tbl_filter(function(lang)
if added[lang] then
return false
end
added[lang] = true
return true
end, opts.ensure_installed)
end
require("nvim-treesitter.configs").setup(opts)
if load_textobjects then
if opts.textobjects then
for _, mod in ipairs({ "move", "select", "swap", "lsp_interop" }) do
if opts.textobjects[mod] and opts.textobjects[mod].enable then
local Loader = require("lazy.core.loader")
Loader.disabled_rtp_plugins["nvim-treesitter-textobjects"] = nil
local plugin = require("lazy.core.config").plugins["nvim-treesitter-textobjects"]
require("lazy.core.loader").source_runtime(plugin.dir, "plugin")
break
end
end
end
end
end,
}
}

View file

@ -0,0 +1,7 @@
return {
{
"folke/trouble.nvim",
-- opts will be merged with the parent spec
opts = {},
},
}

View file

@ -0,0 +1,324 @@
return {
{
"rcarriga/nvim-notify",
keys = {
{
"<leader>un",
function()
require("notify").dismiss({ silent = true, pending = true })
end,
desc = "Dismiss all Notifications",
},
},
opts = {
timeout = 3000,
max_height = function()
return math.floor(vim.o.lines * 0.75)
end,
max_width = function()
return math.floor(vim.o.columns * 0.75)
end,
},
},
{
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
opts = function()
return {
options = {
theme = "auto",
globalstatus = true,
disabled_filetypes = { statusline = { "dashboard", "alpha" } },
},
sections = {
lualine_a = { "mode" },
lualine_b = { "branch" },
lualine_c = {
{
"diagnostics",
symbols = {
error = "",
warn = "",
info = "",
hint = "󰌵",
},
},
{ "filetype", icon_only = true, separator = "", padding = { left = 1, right = 0 } },
{ "filename", path = 1, symbols = { modified = "", readonly = "", unnamed = "" } },
{
function() return require("nvim-navic").get_location() end,
cond = function() return package.loaded["nvim-navic"] and require("nvim-navic").is_available() end,
},
},
lualine_x = {
{
function() return require("noice").api.status.command.get() end,
cond = function() return package.loaded["noice"] and require("noice").api.status.command.has() end,
},
{
function() return require("noice").api.status.mode.get() end,
cond = function() return package.loaded["noice"] and require("noice").api.status.mode.has() end,
},
{
function() return "" .. require("dap").status() end,
cond = function () return package.loaded["dap"] and require("dap").status() ~= "" end,
},
{ require("lazy.status").updates, cond = require("lazy.status").has_updates},
{
"diff",
symbols = {
added = "",
modified = "󰄱",
removed = "",
},
},
},
lualine_y = {
{ "progress", separator = " ", padding = { left = 1, right = 0 } },
{ "location", padding = { left = 0, right = 1 } },
},
lualine_z = {
function()
return "" .. os.date("%R")
end,
},
},
extensions = { "neo-tree", "lazy" },
}
end,
},
{
"lukas-reineke/indent-blankline.nvim",
event = { "BufReadPost", "BufNewFile" },
opts = {
-- char = "▏",
char = "",
filetype_exclude = {
"help",
"alpha",
"dashboard",
"neo-tree",
"Trouble",
"lazy",
"mason",
"notify",
"toggleterm",
"lazyterm",
},
show_trailing_blankline_indent = false,
show_current_context = false,
},
},
{
"echasnovski/mini.indentscope",
version = false, -- wait till new 0.7.0 release to put it back on semver
event = { "BufReadPre", "BufNewFile" },
opts = {
-- symbol = "▏",
symbol = "",
options = { try_as_border = true },
},
init = function()
vim.api.nvim_create_autocmd("FileType", {
pattern = {
"help",
"alpha",
"dashboard",
"neo-tree",
"Trouble",
"lazy",
"mason",
"notify",
"toggleterm",
"lazyterm",
},
callback = function()
vim.b.miniindentscope_disable = true
end,
})
end,
},
{
"akinsho/bufferline.nvim",
event = "VeryLazy",
keys = {
{ "<leader>bp", "<Cmd>BufferLineTogglePin<CR>", desc = "Toggle pin" },
{ "<leader>bP", "<Cmd>BufferLineGroupClose ungrouped<CR>", desc = "Delete non-pinned buffers" },
},
opts = {
options = {
-- stylua: ignore
close_command = function(n) require("mini.bufremove").delete(n, false) end,
-- stylua: ignore
right_mouse_command = function(n) require("mini.bufremove").delete(n, false) end,
diagnostics = "nvim_lsp",
always_show_bufferline = false,
diagnostics_indicator = function(_, _, diag)
local icons = require("lazyvim.config").icons.diagnostics
local ret = (diag.error and icons.Error .. diag.error .. " " or "")
.. (diag.warning and icons.Warn .. diag.warning or "")
return vim.trim(ret)
end,
offsets = {
{
filetype = "neo-tree",
text = "Neo-tree",
highlight = "Directory",
text_align = "left",
},
},
},
},
},
{
"folke/which-key.nvim",
event = "VeryLazy",
opts = {
plugins = { spelling = true },
defaults = {
mode = { "n", "v" },
["g"] = { name = "+goto" },
["gz"] = { name = "+surround" },
["]"] = { name = "+next" },
["["] = { name = "+prev" },
["<leader><tab>"] = { name = "+tabs" },
["<leader>b"] = { name = "+buffer" },
["<leader>c"] = { name = "+colors" },
["<leader>l"] = { name = "+lsp" },
["<leader>f"] = { name = "+file/find" },
["<leader>g"] = { name = "+goto" },
["<leader>u"] = { name = "+ui" },
["<leader>w"] = { name = "+windows" },
["<leader>x"] = { name = "+diagnostics/quickfix" },
},
},
config = function(_, opts)
local wk = require("which-key")
wk.setup(opts)
wk.register(opts.defaults)
end,
},
{
"folke/noice.nvim",
event = "VeryLazy",
opts = {
lsp = {
override = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true,
},
hover = { enabled = false },
signature = { enabled = false },
},
routes = {
{
filter = {
event = "msg_show",
any = {
{ find = "%d+L, %d+B" },
{ find = "; after #%d+" },
{ find = "; before #%d+" },
},
},
view = "mini",
},
},
presets = {
bottom_search = true,
command_palette = true,
long_message_to_split = true,
inc_rename = true,
},
},
-- stylua: ignore
keys = {
{
"<S-Enter>",
function() require("noice").redirect(vim.fn.getcmdline()) end,
mode = "c",
desc =
"Redirect Cmdline"
},
{
"<leader>snl",
function() require("noice").cmd("last") end,
desc =
"Noice Last Message"
},
{
"<leader>snh",
function() require("noice").cmd("history") end,
desc =
"Noice History"
},
{ "<leader>sna", function() require("noice").cmd("all") end, desc = "Noice All" },
{
"<leader>snd",
function() require("noice").cmd("dismiss") end,
desc =
"Dismiss All"
},
{
"<c-f>",
function() if not require("noice.lsp").scroll(4) then return "<c-f>" end end,
silent = true,
expr = true,
desc =
"Scroll forward",
mode = {
"i", "n", "s" }
},
{
"<c-b>",
function() if not require("noice.lsp").scroll(-4) then return "<c-b>" end end,
silent = true,
expr = true,
desc =
"Scroll backward",
mode = {
"i", "n", "s" }
},
},
},
-- icons
{ "nvim-tree/nvim-web-devicons", lazy = true },
-- ui components
{ "MunifTanjim/nui.nvim", lazy = true },
{
"RRethy/vim-illuminate",
event = { "BufReadPost", "BufNewFile" },
opts = {
delay = 200,
large_file_cutoff = 2000,
large_file_overrides = {
providers = { "lsp" },
},
},
config = function(_, opts)
require("illuminate").configure(opts)
local function map(key, dir, buffer)
vim.keymap.set("n", key, function()
require("illuminate")["goto_" .. dir .. "_reference"](false)
end, { desc = dir:sub(1, 1):upper() .. dir:sub(2) .. " Reference", buffer = buffer })
end
map("]]", "next")
map("[[", "prev")
-- also set it after loading ftplugins, since a lot overwrite [[ and ]]
vim.api.nvim_create_autocmd("FileType", {
callback = function()
local buffer = vim.api.nvim_get_current_buf()
map("]]", "next", buffer)
map("[[", "prev", buffer)
end,
})
end,
keys = {
{ "]]", desc = "Next Reference" },
{ "[[", desc = "Prev Reference" },
},
},
}

Binary file not shown.