- Nvim Theme changed to github-dark-dimmed - keeps it in sync with the kitty theme

- Reorged multiple nvim settings (using LazyVim as primary now)
This commit is contained in:
Pratik Tripathy
2024-01-10 22:04:55 +05:30
parent f9688cf616
commit 8f801384fd
53 changed files with 4030 additions and 170 deletions

View File

@@ -21,4 +21,3 @@ Example: bash ./bootstrap.sh -q --create-links
I have multiple Linux installations on my machine. Linking it from one place (this repository) keeps things tidy. Also, changes to dotfiles automatically get applied to all the distros. I have multiple Linux installations on my machine. Linking it from one place (this repository) keeps things tidy. Also, changes to dotfiles automatically get applied to all the distros.
<!-- TODO: Move as many dotfiles inside ~/.config as possible --> <!-- TODO: Move as many dotfiles inside ~/.config as possible -->

View File

@@ -247,13 +247,14 @@
#: is the cause of the problem. #: is the cause of the problem.
#: }}} #: }}}
font_family JetBrains Mono Nerd Font font_family JetBrains Mono Nerd Font
font_size 14
bold_font auto bold_font auto
static_font auto static_font auto
bold_italic_font auto bold_italic_font auto
font_size 14
disable_ligatures never disable_ligatures never
########################################################### ###########################################################
# From https://erwin.co/kitty-and-nerd-fonts/ # From https://erwin.co/kitty-and-nerd-fonts/
# Symbols Nerd Font complete symbol_map # Symbols Nerd Font complete symbol_map
@@ -422,6 +423,11 @@ cursor_beam_thickness 1
#: }}} #: }}}
scrollback_lines 10000
scrollback_pager_history_size 10
# scrollback_pager less --chop-long-lines --RAW-CONTROL-CHARS +INPUT_LINE_NUMBER
scrollback_pager nvim -c 'set ft=man'
#: Mouse {{{ #: Mouse {{{
# mouse_hide_wait 3.0 # mouse_hide_wait 3.0
@@ -1005,6 +1011,18 @@ enable_audio_bell no
#: }}} #: }}}
# Hide title bar
hide_window_decorations yes
window_border_width 0.2pt
# New windows open in the same directory as the current window
map ctrl+shift+enter new_window_with_cwd
enabled_layouts fat:bias=75;full_size=1,stack,tall:bias=50;full_size=2
map F11 toggle_layout stack
# Open nvim on the current directory with ctrl+shift+o
map ctrl+shift+o launch --cwd=current --type=tab nvim
#: Tab bar {{{ #: Tab bar {{{
# tab_bar_edge bottom # tab_bar_edge bottom
@@ -1339,79 +1357,8 @@ enable_audio_bell no
#: }}} #: }}}
background_opacity 0.9 background_opacity 0.95
background_blur 10 background_blur 65
# Catppuccin Mocha - The basic colors
foreground #CDD6F4
background #1E1E2E
selection_foreground #1E1E2E
selection_background #F5E0DC
# Cursor colors
cursor #F5E0DC
cursor_text_color #1E1E2E
# URL underline color when hovering with mouse
url_color #F5E0DC
# Kitty window border colors
active_border_color #B4BEFE
inactive_border_color #6C7086
bell_border_color #F9E2AF
# OS Window titlebar colors
wayland_titlebar_color system
macos_titlebar_color system
# Tab bar colors
active_tab_foreground #11111B
active_tab_background #CBA6F7
inactive_tab_foreground #CDD6F4
inactive_tab_background #181825
tab_bar_background #11111B
# Colors for marks (marked text in the terminal)
mark1_foreground #1E1E2E
mark1_background #B4BEFE
mark2_foreground #1E1E2E
mark2_background #CBA6F7
mark3_foreground #1E1E2E
mark3_background #74C7EC
# The 16 terminal colors
# black
color0 #45475A
color8 #585B70
# red
color1 #F38BA8
color9 #F38BA8
# green
color2 #A6E3A1
color10 #A6E3A1
# yellow
color3 #F9E2AF
color11 #F9E2AF
# blue
color4 #89B4FA
color12 #89B4FA
# magenta
color5 #F5C2E7
color13 #F5C2E7
# cyan
color6 #94E2D5
color14 #94E2D5
# white
color7 #BAC2DE
color15 #A6ADC8
#: Advanced {{{ #: Advanced {{{
@@ -1707,6 +1654,18 @@ color15 #A6ADC8
#: }}} #: }}}
editor nvim
update_check_interval 0
# Enable kitty scrollback.nvim plugin
allow_remote_control yes
listen_on unix:/tmp/kitty
shell_integration enabled
action_alias kitty_scrollback_nvim kitten /home/pratik/.local/share/nvim/lazy/kitty-scrollback.nvim/python/kitty_scrollback_nvim.py
map kitty_mod+h kitty_scrollback_nvim
map kitty_mod+g kitty_scrollback_nvim --config ksb_builtin_last_cmd_output
mouse_map kitty_mod+right press ungrabbed combine : mouse_select_command_output : kitty_scrollback_nvim --config ksb_builtin_last_cmd_output
#: OS specific tweaks {{{ #: OS specific tweaks {{{
# wayland_titlebar_color system # wayland_titlebar_color system
@@ -1930,6 +1889,9 @@ color15 #A6ADC8
#: cause all invocations of the hints kitten to have the --hints- #: cause all invocations of the hints kitten to have the --hints-
#: offset=0 option applied. #: offset=0 option applied.
map ctrl+shift+p nth_window -1
map ctrl+shift+n nth_window +1
#: Clipboard {{{ #: Clipboard {{{
#: Copy to clipboard #: Copy to clipboard
@@ -2581,3 +2543,9 @@ color15 #A6ADC8
#: }}} #: }}}
#: }}} #: }}}
# BEGIN_KITTY_THEME
# GitHub Dark Dimmed
include current-theme.conf
# END_KITTY_THEME

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,15 @@
{
"neodev": {
"library": {
"enabled": true,
"plugins": true
}
},
"neoconf": {
"plugins": {
"lua_ls": {
"enabled": true
}
}
}
}

View File

@@ -1,38 +1,68 @@
-- TODO: Git: Add a plugin -- General Usage and debugging Nvim hints ---------------------------
-- TODO: System install and setup lazygit -- Use `vim.print()` to printout some variable
-- TODO: Setup auto complete -- :lua > `require("plugin-name")` to load a plugin manually
-- TODO: Provide description to each keymap -- To check all issues in plugins -> :checkhealth
-- TODO: tpope/vim-obsession configure to work with tmux-resurrection -- To remove a keymaps -> `vim.keymap.del("n", "<leader>someth")`
-- TODO: Check why Nvim can't find todos -- To override plugin's keymap -> inside "/lua/plugins" create a file > refer to the plugin > change whatever you want in the plugins. cmd, event, ft, keys, opts, dependencies properties are merged. All other properties are overridden. But if any property takes a function -> it'll always be overridden.
-- TODO: Put all plugin configs inside /after/plugin directory -- To remove/disable a plugin - in the above step add `enabled = false` property.
-- Show diff: 2 splits with the files -> :windo diffthis. To exit -> :windo diffoff
-- Loads the system's Vim configs: keeps the VIM & NVim configs in sync -- NOTE: To check all the keymaps -> :Telescope keymaps
local vimrc = vim.fn.stdpath("config") .. "/vim-sync.vim" -- NOTE: Check all notifications -> :Notifications
if vim.loop.fs_stat(vimrc) then
vim.cmd("source " .. vimrc)
end
-- Setup Lazy.nvim package manager -- NOTE: For autoformatting language:
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -- 1. Add to :Mason ensure_installed,
if not vim.loop.fs_stat(lazypath) then -- 2. Add to null-ls sources,
vim.fn.system({ -- 3. Add to conform's formatter_by_ft list.
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable",
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup("plugins", { -- NOTE: For supporting a language LSP:
change_detection = { -- 1. Add to treesitter ensure_installed,
enabled = true, -- 2. Add to :Mason ensure_installed,
notify = false, -- 3. Add to none-ls sources,
}, -- 4. Add to nvim-lint's linters_by_ft list,
}) -- 5. Add to nvim-lspconfig's servers
require("configs.autocommands") ---------------------------------------------------------------------
require("configs.configs") ---------------------------TODO Items--------------------------------
require("configs.keymaps") ---------------------------------------------------------------------
-- Editor
-- TODO: Telescope: search hidden folders (except .git/.idea/.vscode/node_modules etc.)
-- TODO: Telescope: Map opening selected file in different splits/tabs
-- FIXIT: nvim-lsp: Reduce LSP update progress messages-> opts.lsp.progress{}
-- FIXIT: Disable which-key prompts for 'd' - way too much distraction
-- FIXIT: Remove padding from bottom (below lualine) & right border
-- Coding General
-- FIXIT: LSP suggestions hides the line being edited
-- Keymap to close LSP hints?
-- FIXIT: ys commands do not work - some paste thing is overriding it
-- FIXIT: SymbolsOutline doesn't work sometimes
-- TODO: Which file installs mason?
-- TODO: Configure following:
-- 1. coding-json.lua,
-- 2. coding-markdown.lua,
-- 4. coding-python.lua (+black),
-- 5. coding-rust.lua
-- TODO: Have inline hints - rust-tools + https://github.com/simrat39/inlay-hints.nvim
-- Test autocomplete on Rust projects
-- 6. coding-tailwind.lua,
-- 7. coding-typescript.lua (+eslint+prettier),
-- TODO: Typescript - LSP integration - not being attached right now
-- Test autocomplete on Typescript projects
-- 8. coding-yaml.lua,
-- 9. coding-docker.lua
-- TODO: null-ls + dap + nlua + neotest in coding.lua
-- Coding Rust
-- TODO: Rust debugging
-- General
-- TODO: Create Ulauncher plugin for reading/searching/quickaccess saved sessions
-- This needs to open the session in desired terminal app
-- TODO: fzf scipt to show pop-up of all saved sessions on nvim <tab>
-- TODO: Figure out how to quickly stop all code suggestions & completions
-- bootstrap lazy.nvim, LazyVim and your plugins
require("config.lazy")

View File

@@ -0,0 +1,23 @@
{
"extras": [
"lazyvim.plugins.extras.dap.core",
"lazyvim.plugins.extras.dap.nlua",
"lazyvim.plugins.extras.editor.navic",
"lazyvim.plugins.extras.editor.symbols-outline",
"lazyvim.plugins.extras.formatting.black",
"lazyvim.plugins.extras.formatting.prettier",
"lazyvim.plugins.extras.lang.docker",
"lazyvim.plugins.extras.lang.markdown",
"lazyvim.plugins.extras.lang.omnisharp",
"lazyvim.plugins.extras.lang.python",
"lazyvim.plugins.extras.lang.rust",
"lazyvim.plugins.extras.lang.yaml",
"lazyvim.plugins.extras.linting.eslint",
"lazyvim.plugins.extras.lsp.none-ls",
"lazyvim.plugins.extras.test.core"
],
"news": {
"NEWS.md": "2123"
},
"version": 2
}

View File

@@ -0,0 +1,3 @@
-- Autocmds are automatically loaded on the VeryLazy event
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
-- Add any additional autocmds here

View File

@@ -0,0 +1,132 @@
-- Keymaps are automatically loaded on the VeryLazy event
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
-- Add any additional keymaps here
-- Load Keybindings from VIM
local vim_mappings = os.getenv("HOME") .. "/.vim/key_maps.vim"
if vim.loop.fs_stat(vim_mappings) then
vim.cmd("source " .. vim_mappings)
end
-- Delete Lazyvim.keymap that I don't like
vim.keymap.del("n", "<S-h>")
vim.keymap.del("n", "<S-l>")
vim.keymap.del("n", "[b")
vim.keymap.del("n", "]b")
vim.keymap.del("n", "<leader>bb")
vim.keymap.del("n", "<leader>,")
vim.keymap.del("n", "<leader>`")
vim.keymap.del("n", "<leader>qq")
vim.keymap.del("n", "<leader>cd")
vim.keymap.del("n", "<leader>l")
vim.keymap.del("i", ",")
vim.keymap.del("i", ".")
vim.keymap.del("i", ";")
vim.keymap.del("n", "<leader>ur")
vim.keymap.del("n", "<leader>ww")
vim.keymap.del("n", "<leader>wd")
vim.keymap.del("n", "<leader>w-")
vim.keymap.del("n", "<leader>w|")
vim.keymap.del("n", "<leader>-")
vim.keymap.del("n", "<leader>|")
vim.keymap.del("n", "<leader><tab>l")
vim.keymap.del("n", "<leader><tab>f")
vim.keymap.del("n", "<leader><tab><tab>")
vim.keymap.del("n", "<leader><tab>]")
vim.keymap.del("n", "<leader><tab>d")
vim.keymap.del("n", "<leader><tab>[")
vim.keymap.set({ "n" }, "<C-c>", "<cmd> %y+ <CR>", { desc = "Copy entire content of the current buffer" })
vim.keymap.set("n", "<leader>fn", "<cmd>enew<CR>", { desc = "Create new file/buffer" })
-- Following are copied from LazyVim - will use them elsewhere as well
-----------------------------------------------------------------------
-- Better up/down
vim.keymap.set({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
vim.keymap.set({ "n", "x" }, "k", "v:count == 0 ? 'gk' : 'k'", { expr = 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" })
-- Move Lines
vim.keymap.set("n", "<A-j>", "<cmd>m .+1<cr>==", { desc = "Move line down" })
vim.keymap.set("n", "<A-k>", "<cmd>m .-2<cr>==", { desc = "Move line up" })
vim.keymap.set("v", "<A-j>", ":m '>+1<cr>gv=gv", { desc = "Move line down" })
vim.keymap.set("v", "<A-k>", ":m '<-2<cr>gv=gv", { desc = "Move line up" })
-- Traverse Buffer
vim.keymap.set("n", "<Tab>", "<cmd>bnext<CR>", { desc = "Switch to next buffer" })
vim.keymap.set("n", "<S-Tab>", "<cmd>bprevious<CR>", { desc = "Switch to previous buffer" })
-- Save file
vim.keymap.set({ "i", "x", "n", "s" }, "<C-s>", "<cmd>w<cr><esc>", { desc = "Save file" })
vim.keymap.set({ "i", "x", "n", "s" }, "<C-q>", "<cmd>wqa<cr><esc>", { desc = "Save all files and Quit Neovim" })
-- Traverse quickfix
vim.keymap.set("n", "[q", vim.cmd.cprev, { desc = "Previous quickfix" })
vim.keymap.set("n", "]q", vim.cmd.cnext, { desc = "Next quickfix" })
-- Clear search with <esc>
vim.keymap.set({ "i", "n" }, "<esc>", "<cmd>noh<cr><esc>", { desc = "Escape and clear hlsearch" })
vim.keymap.set("n", "n", "'Nn'[v:searchforward].'zv'", { 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].'zv'", { 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" })
-- Clear search, diff update and redraw
vim.keymap.set(
"n",
"<leader>/",
"<Cmd>nohlsearch<Bar>diffupdate<Bar>normal! <C-L><CR>",
{ desc = "Redraw / clear hlsearch / diff update" }
)
-- TODO: Remember the default keymaps that are difficult to change right now
-- https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
--
-- map("n", "<leader>xl", "<cmd>lopen<cr>", { desc = "Location List" })
-- map("n", "<leader>xq", "<cmd>copen<cr>", { desc = "Quickfix List" })
-- map({ "n", "v" }, "<leader>cf", function() Util.format({ force = true }) end, { desc = "Format" })
-- map("n", "<leader>cd", vim.diagnostic.open_float, { desc = "Line Diagnostics" })
-- map("n", "]d", diagnostic_goto(true), { desc = "Next Diagnostic" })
-- map("n", "[d", diagnostic_goto(false), { desc = "Prev Diagnostic" })
-- map("n", "]e", diagnostic_goto(true, "ERROR"), { desc = "Next Error" })
-- map("n", "[e", diagnostic_goto(false, "ERROR"), { desc = "Prev Error" })
-- map("n", "]w", diagnostic_goto(true, "WARN"), { desc = "Next Warning" })
-- map("n", "[w", diagnostic_goto(false, "WARN"), { desc = "Prev Warning" })
-- map("n", "<leader>uf", function() Util.format.toggle() end, { desc = "Toggle auto format (global)" })
-- map("n", "<leader>uF", function() Util.format.toggle(true) end, { desc = "Toggle auto format (buffer)" })
-- map("n", "<leader>us", function() Util.toggle("spell") end, { desc = "Toggle Spelling" })
-- map("n", "<leader>uw", function() Util.toggle("wrap") end, { desc = "Toggle Word Wrap" })
-- map("n", "<leader>uL", function() Util.toggle("relativenumber") end, { desc = "Toggle Relative Line Numbers" })
-- map("n", "<leader>ul", function() Util.toggle.number() end, { desc = "Toggle Line Numbers" })
-- map("n", "<leader>ud", function() Util.toggle.diagnostics() end, { desc = "Toggle Diagnostics" })
-- map("n", "<leader>uc", function() Util.toggle("conceallevel", false, {0, conceallevel}) end, { desc = "Toggle Conceal" })
-- map( "n", "<leader>uh", function() Util.toggle.inlay_hints() end, { desc = "Toggle Inlay Hints" })
-- map("n", "<leader>uT", function() if vim.b.ts_highlight then vim.treesitter.stop() else vim.treesitter.start() end end, { desc = "Toggle Treesitter Highlight" })
-- map("n", "<leader>gg", function() Util.terminal({ "lazygit" }, { cwd = Util.root(), esc_esc = false, ctrl_hjkl = false }) end, { desc = "Lazygit (root dir)" })
-- map("n", "<leader>gG", function() Util.terminal({ "lazygit" }, {esc_esc = false, ctrl_hjkl = false}) end, { desc = "Lazygit (cwd)" })
-- map("n", "<leader>ui", vim.show_pos, { desc = "Inspect Pos" })
-- map("n", "<leader>ft", lazyterm, { desc = "Terminal (root dir)" })
-- map("n", "<leader>fT", function() Util.terminal() end, { desc = "Terminal (cwd)" })
-- map("n", "<c-/>", lazyterm, { desc = "Terminal (root dir)" })
-- map("n", "<c-_>", lazyterm, { desc = "which_key_ignore" })
-- map("t", "<esc><esc>", "<c-\\><c-n>", { desc = "Enter Normal Mode" })
-- map("t", "<C-h>", "<cmd>wincmd h<cr>", { desc = "Go to left window" })
-- map("t", "<C-j>", "<cmd>wincmd j<cr>", { desc = "Go to lower window" })
-- map("t", "<C-k>", "<cmd>wincmd k<cr>", { desc = "Go to upper window" })
-- map("t", "<C-l>", "<cmd>wincmd l<cr>", { desc = "Go to right window" })
-- map("t", "<C-/>", "<cmd>close<cr>", { desc = "Hide Terminal" })
-- map("t", "<c-_>", "<cmd>close<cr>", { desc = "which_key_ignore" })

View File

@@ -0,0 +1,50 @@
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({
change_detection = {
enabled = true,
notify = false,
},
spec = {
-- add LazyVim and import its plugins
{ "LazyVim/LazyVim", import = "lazyvim.plugins" },
-- import any extras modules here
{ import = "lazyvim.plugins.extras.lang.typescript" },
{ import = "lazyvim.plugins.extras.lang.json" },
-- { import = "lazyvim.plugins.extras.ui.mini-animate" },
-- import/override with your plugins
{ import = "plugins" },
},
defaults = {
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
lazy = false,
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
-- have outdated releases, which may break your Neovim install.
version = false, -- always use the latest git commit
-- version = "*", -- try installing the latest stable version for plugins that support semver
},
install = { colorscheme = { "tokyonight" } },
--checker = { enabled = true }, -- automatically check for plugin updates
performance = {
rtp = {
-- disable some rtp plugins
disabled_plugins = {
"gzip",
"matchit",
"matchparen",
"netrwPlugin",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
},
},
})

View File

@@ -0,0 +1,15 @@
-- Options are automatically loaded before lazy.nvim startup
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
-- Add any additional options here
-- Load configs from VIM
local vim_configs = os.getenv("HOME") .. "/.vim/configs.vim"
if vim.loop.fs_stat(vim_configs) then
vim.cmd("source " .. vim_configs)
end
vim.opt.undodir = vim.fn.stdpath("config") .. "/undo"
vim.opt.backupdir = vim.fn.stdpath("config") .. "/backup/"
vim.opt.wrap = true
vim.opt.cursorline = true

View File

@@ -1,2 +0,0 @@
vim.opt.undodir = vim.fn.stdpath("config") .. "/undo"
vim.opt.backupdir = vim.fn.stdpath("config") .. "/backup/"

View File

@@ -0,0 +1,81 @@
return {
-- Auto completion
{
"hrsh7th/nvim-cmp",
opts = function()
vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true })
local cmp = require("cmp")
local defaults = require("cmp.config.default")()
return {
completion = {
completeopt = "menu,menuone,noinsert",
},
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
["<C-d>"] = cmp.mapping.scroll_docs(-4),
["<C-u>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(),
["<C-x>"] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
["<S-CR>"] = cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Replace,
select = true,
}), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
["<C-CR>"] = function(fallback)
cmp.abort()
fallback()
end,
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "path" },
{ name = "luasnip" },
}, {
{ name = "buffer" },
}),
formatting = {
format = function(_, item)
local icons = require("lazyvim.config").icons.kinds
if icons[item.kind] then
item.kind = icons[item.kind] .. item.kind
end
return item
end,
},
experimental = {
ghost_text = {
hl_group = "CmpGhostText",
},
},
sorting = defaults.sorting,
}
end,
},
-- Snippets
{
"L3MON4D3/LuaSnip",
-- stylua: ignore
keys = {
{
"<tab>",
function()
return require("luasnip").jumpable(1) and "<Plug>luasnip-jump-next" or "<tab>"
end,
expr = true, silent = true, mode = "i",
},
{ "<tab>", function() require("luasnip").jump(1) end, mode = "s" },
{ "<s-tab>", function() require("luasnip").jump(-1) end, mode = { "i", "s" } },
},
},
-- VSCode like Snippets
{ "rafamadriz/friendly-snippets" },
}

View File

@@ -0,0 +1,68 @@
return {
{ "Hoffs/omnisharp-extended-lsp.nvim" },
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
if type(opts.ensure_installed) == "table" then
vim.list_extend(opts.ensure_installed, { "c_sharp" })
end
end,
},
{
"nvimtools/none-ls.nvim",
optional = true,
opts = function(_, opts)
local nls = require("null-ls")
opts.sources = opts.sources or {}
table.insert(opts.sources, nls.builtins.formatting.csharpier)
end,
},
{
"stevearc/conform.nvim",
optional = true,
opts = {
formatters_by_ft = {
cs = { "csharpier" },
},
formatters = {
csharpier = {
command = "dotnet-csharpier",
args = { "--write-stdout" },
},
},
},
},
{
"williamboman/mason.nvim",
opts = function(_, opts)
opts.ensure_installed = opts.ensure_installed or {}
table.insert(opts.ensure_installed, "csharpier")
end,
},
{
"neovim/nvim-lspconfig",
opts = {
servers = {
omnisharp = {
handlers = {
["textDocument/definition"] = function(...)
return require("omnisharp_extended").handler(...)
end,
},
keys = {
{
"gd",
function()
require("omnisharp_extended").telescope_lsp_definitions()
end,
desc = "Goto Definition",
},
},
enable_roslyn_analyzers = true,
organize_imports_on_format = true,
enable_import_completion = true,
},
},
},
},
}

View File

@@ -0,0 +1 @@
return {}

View File

@@ -0,0 +1 @@
return {}

View File

@@ -0,0 +1 @@
return {}

View File

@@ -0,0 +1 @@
return {}

View File

@@ -0,0 +1 @@
return {}

View File

@@ -0,0 +1 @@
return {}

View File

@@ -0,0 +1 @@
return {}

View File

@@ -0,0 +1 @@
return {}

View File

@@ -0,0 +1,293 @@
return {
-- FIX: Vale (markdown linter) isn't working
-- TODO: Configure the linter
-- Treesitter is a parser generator tool that we can use for syntax highlighting
{
"nvim-treesitter/nvim-treesitter",
lazy = false,
keys = {
{ "<C-Space>", desc = "Increment selection" },
{ "<C-CR>", desc = "Increment scope selection" },
{ "<bs>", desc = "Decrement selection", mode = "x" },
},
---@type TSConfig
---@diagnostic disable-next-line: missing-fields
opts = {
highlight = { enable = true },
indent = { enable = true },
auto_install = true,
-- stylua: ignore
ensure_installed = {
"lua", "luadoc", "luap", "vim", "vimdoc",
"diff","query", "regex", "toml", "yaml",
"c", "python", "bash",
"markdown", "markdown_inline",
"html", "javascript", "jsdoc", "json", "jsonc", "tsx", "typescript",
},
incremental_selection = {
enable = true,
keymaps = {
init_selection = "<C-space>",
node_incremental = "<C-space>",
scope_incremental = "<C-CR>",
node_decremental = "<bs>",
},
},
textobjects = {
-- stylua: ignore
-- Defaults(not mentioned below): Select text objects (similar to ip & ap)
-- af: Selects around current function
-- if: Selects inside current function
-- ac: around current Class
-- ic: inside current Class
move = {
-- Jump to next and previous text objects
enable = true,
goto_next_start = {
["]f"] = { query = "@function.outer", desc = "Goto next inner function start" },
["]c"] = { query = "@class.outer", desc = "Goto next inner class start" },
},
goto_next_end = {
["]F"] = { query = "@function.outer", desc = "Goto next outer function end" },
["]C"] = { query = "@class.outer", desc = "Goto next outer class end" },
},
goto_previous_start = {
["[f"] = { query = "@function.outer", desc = "Goto goto previous inner function start" },
["[c"] = { query = "@class.outer", desc = "Previous inner class start" },
},
goto_previous_end = {
["[F"] = { query = "@function.outer", desc = "Goto goto previous outer function start" },
["[C"] = { query = "@class.outer", desc = "Goto previous outer class start" },
},
},
},
},
},
-- LSP configuration
{
"neovim/nvim-lspconfig",
-- lazy = false,
opts = {
-- Enable this to enable the builtin LSP inlay hints on Neovim >= 0.10.0
-- Be aware that you also will need to properly configure your LSP server to
-- provide the inlay hints.
inlay_hints = {
enabled = true,
},
-- add any global capabilities here
capabilities = {},
-- options for vim.lsp.buf.format
-- `bufnr` and `filter` is handled by the LazyVim formatter,
-- but can be also overridden when specified
format = {
formatting_options = nil,
timeout_ms = nil,
},
-- LSP Server Settings
servers = {
lua_ls = {
settings = {
Lua = {
workspace = {
checkThirdParty = false,
},
completion = {
callSnippet = "Replace",
},
},
},
},
tsserver = {
keys = {
{
"<leader>co",
function()
vim.lsp.buf.code_action({
apply = true,
context = {
only = { "source.organizeImports.ts" },
diagnostics = {},
},
})
end,
desc = "Organize Imports",
},
{
"<leader>cR",
function()
vim.lsp.buf.code_action({
apply = true,
context = {
only = { "source.removeUnused.ts" },
diagnostics = {},
},
})
end,
desc = "Remove Unused Imports",
},
},
settings = {
typescript = {
format = {},
},
javascript = {
format = {},
},
completions = {
completeFunctionCalls = true,
},
},
},
},
},
},
-- Linting
{
"mfussenegger/nvim-lint",
lazy = false,
opts = {
-- Event to trigger linters
events = { "BufWritePost", "BufReadPost", "InsertLeave" },
linters_by_ft = {
fish = { "fish" },
-- Use the "*" filetype to run linters on all filetypes.
-- ['*'] = { 'global linter' },
-- Use the "_" filetype to run linters on filetypes that don't have other linters configured.
-- ['_'] = { 'fallback linter' },
},
-- LazyVim extension to easily override linter options
-- or add custom linters.
---@type table<string,table>
linters = {
-- -- Example of using selene only when a selene.toml file is present
-- selene = {
-- -- `condition` is another LazyVim extension that allows you to
-- -- dynamically enable/disable linters based on the context.
-- condition = function(ctx)
-- return vim.fs.find({ "selene.toml" }, { path = ctx.filename, upward = true })[1]
-- end,
-- },
},
},
},
-- Mason configuration
{
"williamboman/mason.nvim",
opts = {
ensure_installed = {
"prettier",
"js-debug-adapter",
"eslint-lsp",
"json-lsp",
"typescript-language-server",
"codelldb",
"rust-analyzer",
"yaml-language-server",
"black",
"csharpier",
"omnisharp",
"stylua",
"lua-language-server",
"shfmt",
"pyright",
"hadolint",
"docker-compose-language-service",
"dockerfile-language-server",
"vale",
"vale-ls",
"markdownlint",
"marksman",
"taplo",
},
},
},
{ "williamboman/mason-lspconfig.nvim" },
-- Formatter
{
"nvimtools/none-ls.nvim",
lazy = false,
opts = function(_, opts)
local nls = require("null-ls")
opts.root_dir = opts.root_dir
or require("null-ls.utils").root_pattern(".null-ls-root", ".neoconf.json", "Makefile", ".git")
opts.sources = vim.list_extend(opts.sources or {}, {
nls.builtins.formatting.fish_indent,
nls.builtins.diagnostics.fish,
nls.builtins.formatting.stylua,
nls.builtins.formatting.shfmt,
nls.builtins.formatting.eslint_d,
nls.builtins.formatting.black,
nls.builtins.formatting.prettierd,
})
end,
},
-- Auto pairs
{ "echasnovski/mini.pairs" },
-- Automatically add closing tags for HTML and JSX
{ "windwp/nvim-ts-autotag" },
-- Surround things
{ "tpope/vim-surround" },
-- Tpope one(above) is more predictable
{ "echasnovski/mini.surround", enabled = false },
-- Comments
{ "JoosepAlviste/nvim-ts-context-commentstring" },
{ "echasnovski/mini.comment" },
-- Better text-objects
{
-- Extends a & i with the following:
-- a/i <space>: around/inside continuous Whitespace
-- a/i ": around/inside double quotes
-- a/i ': around/inside single quotes
-- a/i `: around/inside backticks
-- a/i q: around/inside any 2 quotes of any kind (`, ', ")
-- a/i (: around/inside braces - does NOT include spaces around
-- a/i ): around/inside braces - DOES include spaces around
-- a/i ]/[
-- a/i }/{
-- a/i b: around/inside any 2 braces of any kind (), ], }) - NOT including spaces around
-- a/i >: around/inside tags - does NOT include spaces
-- a/i <: around/inside tags - DOES include spaces
-- a/i t: around/inside 2 tags of any kind
-- a/i _: around/inside 2 Underscores
-- a/i a: around/inside function arguments
-- a/i f: around/inside Function
-- a/i c: around/inside class
-- a/i o: around/inside any block of code (conditional, loop, etc.)
"echasnovski/mini.ai",
},
-- Indent guides for Neovim
{
"lukas-reineke/indent-blankline.nvim",
opts = { scope = { enabled = true } },
},
-- This highlights the current level of indentation and animates the highlighting
{ "echasnovski/mini.indentscope" },
-- Navic does a much better job without taking any screen space
{ "nvim-treesitter/nvim-treesitter-context", enabled = false },
-- VSCode like breadcrumbs in lualine
{ "SmiteshP/nvim-navic" },
-- Shows symbols in the current window on a vsplit on left
{
"simrat39/symbols-outline.nvim",
keys = { { "<leader>cs", "<cmd>SymbolsOutline<cr>", desc = "Symbols Outline" } },
},
}

View File

@@ -1,27 +1,16 @@
return { return {
{ {
"rebelot/kanagawa.nvim", "LazyVim/LazyVim",
name = "kanagawa", opts = {
priority = 1000, colorscheme = "github_dark_dimmed",
lazy = false, },
config = function()
vim.cmd.colorscheme "kanagawa-wave"
end
}, },
{ {
"catppuccin/nvim", "projekt0n/github-nvim-theme",
name = "catppuccin", lazy = false,
priority = 1000, priority = 1000,
config = function() config = function()
require("catppuccin").setup({ -- vim.cmd("colorscheme github_dark_dimmed")
show_end_of_buffer = true, end,
integrations = {
cmp = true,
gitsigns = true,
nvimtree = true,
},
})
-- vim.cmd.colorscheme "catppuccin-mocha"
end
}, },
} }

View File

@@ -0,0 +1,549 @@
-- Most of the code below is for easy reference to lazyvim shortcuts
-- So, I can view and change them easily
local Util = require("lazyvim.util")
return {
-- icons
{ "nvim-tree/nvim-web-devicons" },
-- Changes the Nvim root to git root
{
"airblade/vim-rooter",
config = function()
vim.g.rooter_cd_cmd = "tcd" -- Use tcd command to change the root
end,
},
-- File Explorer
{
"nvim-neo-tree/neo-tree.nvim",
branch = "v3.x",
keys = {
{ "<leader>e", ":Neotree filesystem toggle<CR>", desc = "Explorer NeoTree (root dir)", remap = true },
-- Change the rest if required
{
"<leader>fe",
function()
require("neo-tree.command").execute({ toggle = true, dir = Util.root() })
end,
desc = "Explorer NeoTree (root dir)",
},
{
"<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 (cwd)", remap = true },
{
"<leader>ge",
function()
require("neo-tree.command").execute({ source = "git_status", toggle = true })
end,
desc = "Git explorer",
},
{
"<leader>be",
function()
require("neo-tree.command").execute({ source = "buffers", toggle = true })
end,
desc = "Buffer explorer",
},
},
opts = {
enable_git_status = true,
filesystem = {
bind_to_cwd = true,
follow_current_file = {
enabled = true, -- Highlight the current buffer
leave_dirs_open = true,
},
use_libuv_file_watcher = true, -- Sync file system changes
filtered_items = {
visible = true,
show_hidden_count = true,
hide_dotfile = false,
hide_gitignore = false,
},
},
window = {
position = "left",
width = 30, -- Saner window size
mappings = {
["s"] = "open_split", -- Default vim keymap for horizontal split
["v"] = "open_vsplit", -- Default vim keymap for vertical split
},
},
default_component_configs = {
indent = {
indent_size = 2, -- Compact tree display
},
},
sources = { "filesystem", "buffers", "git_status", "document_symbols" },
open_files_do_not_replace_types = { "terminal", "Trouble", "trouble", "qf", "Outline" },
},
},
-- Search and replace in multiple files
{
"nvim-pack/nvim-spectre",
keys = {
{
"<leader>sr",
function()
require("spectre").open()
end,
desc = "Replace in files (Spectre)",
},
},
},
-- Fuzzy finder of many things
{
"nvim-telescope/telescope.nvim",
keys = {
-- find
{ "<leader>ff", Util.telescope("files"), desc = "Find Files (root dir)" },
{ "<leader><space>", Util.telescope("files"), desc = "Find Files (root dir)" },
{ "<leader>fb", "<cmd>Telescope buffers sort_mru=true sort_lastused=true<cr>", desc = "Buffers" },
{ "<leader>fc", Util.telescope.config_files(), desc = "Find Config File" },
{ "<leader>fF", Util.telescope("files", { cwd = false }), desc = "Find Files (cwd)" },
{ "<leader>fr", "<cmd>Telescope oldfiles<cr>", desc = "Recent" },
{ "<leader>fR", Util.telescope("oldfiles", { cwd = vim.loop.cwd() }), desc = "Recent (cwd)" },
{ "<leader>/", Util.telescope("live_grep"), desc = "Grep (root dir)" },
{ "<leader>:", "<cmd>Telescope command_history<cr>", desc = "Command History" },
-- git
{ "<leader>gc", "<cmd>Telescope git_commits<CR>", desc = "commits" },
{ "<leader>gs", "<cmd>Telescope git_status<CR>", desc = "status" },
-- search
{ '<leader>s"', "<cmd>Telescope registers<cr>", desc = "Registers" },
{ "<leader>sa", "<cmd>Telescope autocommands<cr>", desc = "Auto Commands" },
{ "<leader>sb", "<cmd>Telescope current_buffer_fuzzy_find<cr>", desc = "Buffer" },
{ "<leader>sc", "<cmd>Telescope command_history<cr>", desc = "Command History" },
{ "<leader>sC", "<cmd>Telescope commands<cr>", desc = "Commands" },
{ "<leader>sd", "<cmd>Telescope diagnostics bufnr=0<cr>", desc = "Document diagnostics" },
{ "<leader>sD", "<cmd>Telescope diagnostics<cr>", desc = "Workspace diagnostics" },
{ "<leader>sg", Util.telescope("live_grep"), desc = "Grep (root dir)" },
{ "<leader>sG", Util.telescope("live_grep", { cwd = false }), desc = "Grep (cwd)" },
{ "<leader>sh", "<cmd>Telescope help_tags<cr>", desc = "Help Pages" },
{ "<leader>sH", "<cmd>Telescope highlights<cr>", desc = "Search Highlight Groups" },
{ "<leader>sk", "<cmd>Telescope keymaps<cr>", desc = "Key Maps" },
{ "<leader>sM", "<cmd>Telescope man_pages<cr>", desc = "Man Pages" },
{ "<leader>sm", "<cmd>Telescope marks<cr>", desc = "Jump to Mark" },
{ "<leader>so", "<cmd>Telescope vim_options<cr>", desc = "Options" },
{ "<leader>sR", "<cmd>Telescope resume<cr>", desc = "Resume" },
{ "<leader>sw", Util.telescope("grep_string", { word_match = "-w" }), desc = "Word (root dir)" },
{ "<leader>sW", Util.telescope("grep_string", { cwd = false, word_match = "-w" }), desc = "Word (cwd)" },
{ "<leader>sw", Util.telescope("grep_string"), mode = "v", desc = "Selection (root dir)" },
{ "<leader>sW", Util.telescope("grep_string", { cwd = false }), mode = "v", desc = "Selection (cwd)" },
{
"<leader>uC",
Util.telescope("colorscheme", { enable_preview = true }),
desc = "Colorscheme with preview",
},
{
"<leader>ss",
function()
require("telescope.builtin").lsp_document_symbols({
symbols = require("lazyvim.config").get_kind_filter(),
})
end,
desc = "Goto Symbol",
},
{
"<leader>sS",
function()
require("telescope.builtin").lsp_dynamic_workspace_symbols({
symbols = require("lazyvim.config").get_kind_filter(),
})
end,
desc = "Goto Symbol (Workspace)",
},
},
},
-- Confusing hence disabled
{ "folke/flash.nvim", enabled = false },
-- EasyMotion is better
{ "easymotion/vim-easymotion" },
-- Adds and reads "keys" property in each plugins
{
"folke/which-key.nvim",
opts = {
plugins = { spelling = true },
defaults = {
mode = { "n", "v" },
["g"] = { name = "+goto" },
["ys"] = { name = "+surround" },
["]"] = { name = "+next" },
["["] = { name = "+prev" },
["<leader><tab>"] = { name = "+tabs" },
["<leader>b"] = { name = "+buffer" },
["<leader>c"] = { name = "+code" },
["<leader>f"] = { name = "+file/find" },
["<leader>g"] = { name = "+git" },
["<leader>gh"] = { name = "+hunks" },
["<leader>q"] = { name = "+quit/session" },
["<leader>s"] = { name = "+search" },
["<leader>u"] = { name = "+ui" },
["<leader>w"] = { name = "+windows" },
["<leader>x"] = { name = "+diagnostics/quickfix" },
},
},
},
-- Display undotree
{
"mbbill/undotree",
config = function()
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
end,
},
-- TODO: install gitblame plugin
-- Highlights text that changed since last commit
{
"lewis6991/gitsigns.nvim",
opts = {
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", "<leader>ghp", gs.preview_hunk, "Preview Hunk")
map("n", "<leader>gH", gs.preview_hunk, "Preview Hunk")
map("n", "]h", gs.next_hunk, "Next Hunk")
map("n", "[h", gs.prev_hunk, "Prev Hunk")
end,
},
},
-- Automatically highlights other instances of the word under cursor
{
"RRethy/vim-illuminate",
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" },
},
},
-- Remove Buffer
{
"echasnovski/mini.bufremove",
keys = {
{
"<leader>br",
function()
if vim.bo.modified then
vim.cmd.write()
end
require("mini.bufremove").delete(0)
end,
desc = "Save and remove Buffer",
},
-- stylua: ignore
{ "<leader>bR", function() require("mini.bufremove").delete(0, true) end, desc = "Force Remove Buffer" },
},
},
-- Diagnostics lists
{
"folke/trouble.nvim",
keys = {
{ "<leader>xx", "<cmd>TroubleToggle document_diagnostics<cr>", desc = "Document Diagnostics (Trouble)" },
{ "<leader>xX", "<cmd>TroubleToggle workspace_diagnostics<cr>", desc = "Workspace Diagnostics (Trouble)" },
{ "<leader>xL", "<cmd>TroubleToggle loclist<cr>", desc = "Location List (Trouble)" },
{ "<leader>xQ", "<cmd>TroubleToggle quickfix<cr>", desc = "Quickfix List (Trouble)" },
{
"[e",
function()
if require("trouble").is_open() then
require("trouble").previous({ skip_groups = true, jump = true })
else
local ok, err = pcall(vim.cmd.cprev)
if not ok then
vim.notify(err, vim.log.levels.ERROR)
end
end
end,
desc = "Previous trouble/quickfix item",
},
{
"]e",
function()
if require("trouble").is_open() then
require("trouble").next({ skip_groups = true, jump = true })
else
local ok, err = pcall(vim.cmd.cnext)
if not ok then
vim.notify(err, vim.log.levels.ERROR)
end
end
end,
desc = "Next trouble/quickfix item",
},
},
},
-- Finds and lists all of the TODO, HACK, BUG, etc comment
{
"folke/todo-comments.nvim",
-- 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" },
{ "<leader>xt", "<cmd>TodoTrouble<cr>", desc = "Todo (Trouble)" },
{ "<leader>xT", "<cmd>TodoTrouble keywords=TODO,FIX,FIXME<cr>", desc = "Todo/Fix/Fixme (Trouble)" },
{ "<leader>st", "<cmd>TodoTelescope<cr>", desc = "Todo" },
{ "<leader>sT", "<cmd>TodoTelescope keywords=TODO,FIX,FIXME<cr>", desc = "Todo/Fix/Fixme" },
},
},
-- UI Stuff ------------------------------------------------------------------------
-- Fancy-looking tabs, which include filetype icons and close buttons.
{ "akinsho/bufferline.nvim" },
-- Fancy Statusline
{
"nvim-lualine/lualine.nvim",
opts = function()
local lualine_require = require("lualine_require")
lualine_require.require = require
local icons = require("lazyvim.config").icons
vim.o.laststatus = vim.g.lualine_laststatus
return {
options = {
theme = "auto",
globalstatus = true,
disabled_filetypes = { statusline = { "dashboard", "alpha", "starter" } },
},
sections = {
lualine_a = { "mode" },
lualine_b = { "branch" },
lualine_c = {
Util.lualine.root_dir(),
{
"diagnostics",
symbols = {
error = icons.diagnostics.Error,
warn = icons.diagnostics.Warn,
info = icons.diagnostics.Info,
hint = icons.diagnostics.Hint,
},
},
{ "filetype", icon_only = true, separator = "", padding = { left = 1, right = 0 } },
{ Util.lualine.pretty_path() },
},
lualine_x = {
-- stylua: ignore
{
function() return require("noice").api.status.command.get() end,
cond = function() return package.loaded["noice"] and require("noice").api.status.command.has() end,
color = Util.ui.fg("Statement"),
},
-- stylua: ignore
{
function() return require("noice").api.status.mode.get() end,
cond = function() return package.loaded["noice"] and require("noice").api.status.mode.has() end,
color = Util.ui.fg("Constant"),
},
-- stylua: ignore
{
function() return "" .. require("dap").status() end,
cond = function () return package.loaded["dap"] and require("dap").status() ~= "" end,
color = Util.ui.fg("Debug"),
},
{
require("lazy.status").updates,
cond = require("lazy.status").has_updates,
color = Util.ui.fg("Special"),
},
{
"diff",
symbols = {
added = icons.git.added,
modified = icons.git.modified,
removed = icons.git.removed,
},
source = function()
local gitsigns = vim.b.gitsigns_status_dict
if gitsigns then
return {
added = gitsigns.added,
modified = gitsigns.changed,
removed = gitsigns.removed,
}
end
end,
},
},
lualine_y = {},
lualine_z = { { "progress" }, { "location" } },
},
extensions = { "neo-tree", "lazy" },
}
end,
},
-- Better vim.ui
{ "stevearc/dressing.nvim" },
-- Better `vim.notify()`
{
"rcarriga/nvim-notify",
keys = {
{
"<leader>un",
function()
require("notify").dismiss({ silent = true, pending = true })
end,
desc = "Dismiss all Notifications",
},
},
opts = {
render = "wrapped-compact", -- Smaller popups
timeout = 3000,
max_height = function()
return math.floor(vim.o.lines * 0.25)
end,
max_width = function()
return math.floor(vim.o.columns * 0.5)
end,
on_open = function(win)
vim.api.nvim_win_set_config(win, { zindex = 100 })
end,
},
},
-- Completely replaces the UI for messages, cmdline and the popupmenu.
{
"folke/noice.nvim",
opts = {
routes = {
{
-- Show popup message when @recording macros
view = "notify",
filter = { event = "msg_showmode" },
},
{
-- Direct some messages to bottom - obove lualine
view = "mini",
filter = {
event = "msg_show",
any = {
{ find = "%d+L, %d+B" },
{ find = "; after #%d+" },
{ find = "; before #%d+" },
-- Display delete, yank, jump notifications at bottom
{ find = "yanked" },
{ find = "fewer lines" },
{ find = "more lines" },
{ find = "EasyMotion" }, -- This can be completely discarded
{ find = "Target key" },
{ find = "search hit BOTTOM" },
{ find = "lines to indent" },
{ find = "lines indented" },
},
},
},
-- TODO: Some messages needs to suppressed completely. Figure out how???
},
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"}},
},
},
-- ui components
{ "MunifTanjim/nui.nvim" },
{ "goolord/alpha-nvim", enabled = false },
{
"akinsho/toggleterm.nvim",
cmd = "ToggleTerm",
build = ":ToggleTerm",
keys = {
-- NOTE: Do not use <leader> for terminals, there would be issue escaping
-- F13 = Shift + F1
{ "<F13>", "<cmd>ToggleTerm direction=horizontal<cr>", desc = "Toggle horizontal terminal" },
},
opts = {
open_mapping = [[<F13>]],
direction = "horizontal",
shade_filetypes = {},
hide_numbers = true,
insert_mappings = true,
terminal_mappings = true,
start_in_insert = true,
close_on_exit = true,
float_opts = {
border = "curved",
},
},
},
{
"mikesmithgh/kitty-scrollback.nvim",
lazy = true,
cmd = { "KittyScrollbackGenerateKittens", "KittyScrollbackCheckHealth" },
event = { "User KittyScrollbackLaunch" },
version = "^3.0.0",
opts = {
status_window = {
icons = { nvim = "" },
},
},
config = function()
require("kitty-scrollback").setup()
end,
},
}

View File

@@ -0,0 +1,15 @@
return {
{
"stevearc/conform.nvim",
keys = {
{
"<leader>cF",
function()
require("conform").format({ formatters = { "injected" } })
end,
mode = { "n", "v" },
desc = "Format Injected Langs",
},
},
},
}

View File

@@ -0,0 +1,26 @@
return {
{
"mfussenegger/nvim-lint",
opts = {
linters_by_ft = {
text = { "vale" },
json = { "jsonlint" },
markdown = { "markdownlint", "vale" },
rst = { "vale" },
dockerfile = { "hadolint" },
go = { "golangcilint" },
jq = { "jq" },
bash = { "shellcheck" },
shell = { "shellcheck" },
yaml = { "yamllint" },
zsh = { "zsh" },
typescript = { "eslint_d" },
javascript = { "eslint_d" },
-- Use the "*" filetype to run linters on all filetypes.
-- ['*'] = { 'global linter' },
-- Use the "_" filetype to run linters on filetypes that don't have other linters configured.
-- ['_'] = { 'fallback linter' },
},
},
},
}

View File

@@ -0,0 +1,12 @@
return {
-- Don't measure startuptime
{ "dstein64/vim-startuptime", enabled = false },
-- Session management.
{
"folke/persistence.nvim",
opts = {
dir = vim.fn.expand(vim.fn.stdpath("config") .. "/sessions/"),
},
},
}

View File

@@ -1 +0,0 @@
../../.vim/spell

View File

@@ -0,0 +1,4 @@
indent_type = "Spaces"
indent_width = 4
column_width = 120
quote_style = "AutoPreferDouble"

View File

@@ -1,15 +0,0 @@
""""""""""""""""""""""""""""""""""""""
"
" Source common keymaps & configs from VIM
"
""""""""""""""""""""""""""""""""""""""
let $VIMDIR="$HOME/.vim"
" Load VIM Configurations
source $VIMDIR/configs.vim
" Load Keybindings from VIM
source $VIMDIR/key_maps.vim
" Save session files to $HOME/.vim/session directory
let g:session_dir="$VIMDIR/session"

Submodule common/.config/nvim_switch/nvchad added at c2ec317b1b

View File

@@ -0,0 +1,32 @@
-- TODO: Git: Add a plugin
-- TODO: System install and setup lazygit
-- TODO: Setup auto complete
-- TODO: Provide description to each keymap
-- TODO: tpope/vim-obsession configure to work with tmux-resurrection
-- TODO: Check why Nvim can't find todos
-- TODO: Put all plugin configs inside /after/plugin directory
-- Setup Lazy.nvim package manager
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable",
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup("plugins", {
change_detection = {
enabled = true,
notify = false,
},
})
require("configs.autocommands")
require("configs.configs")
require("configs.keymaps")

View File

@@ -0,0 +1,8 @@
-- Load configs from VIM
local vim_configs = os.getenv("HOME") .. "/.vim/configs.vim"
if vim.loop.fs_stat(vim_configs) then
vim.cmd("source " .. vim_configs)
end
vim.opt.undodir = vim.fn.stdpath("config") .. "/undo"
vim.opt.backupdir = vim.fn.stdpath("config") .. "/backup/"

View File

@@ -1,3 +1,9 @@
-- Load Keybindings from VIM
local vim_mappings = os.getenv("HOME") .. "/.vim/key_maps.vim"
if vim.loop.fs_stat(vim_mappings) then
vim.cmd("source " .. vim_mappings)
end
-- Remap for dealing with word wrap -- Remap for dealing with word wrap
vim.keymap.set("n", "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) vim.keymap.set("n", "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
vim.keymap.set("n", "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true }) vim.keymap.set("n", "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })

View File

@@ -0,0 +1,27 @@
return {
{
"rebelot/kanagawa.nvim",
name = "kanagawa",
priority = 1000,
lazy = false,
config = function()
vim.cmd.colorscheme "kanagawa-wave"
end
},
{
"catppuccin/nvim",
name = "catppuccin",
priority = 1000,
config = function()
require("catppuccin").setup({
show_end_of_buffer = true,
integrations = {
cmp = true,
gitsigns = true,
nvimtree = true,
},
})
-- vim.cmd.colorscheme "catppuccin-mocha"
end
},
}

View File

@@ -1,4 +1,4 @@
" vim-plug: Vim plugin manager " VIM-PLUG: vIM PLUGIN MANAGER
" ============================ " ============================
" "
" Download plug.vim and put it in ~/.vim/autoload " Download plug.vim and put it in ~/.vim/autoload

View File

@@ -20,8 +20,8 @@ set showcmd " Write out commands on status line
set laststatus=2 " Show a status line set laststatus=2 " Show a status line
set wrap " Wrap text set wrap " Wrap text
set number " Show line numbers set number " Show line numbers
set ruler
set relativenumber " Relative line numbers set relativenumber " Relative line numbers
set ruler
set shortmess+=I " Disable the default Vim startup message. set shortmess+=I " Disable the default Vim startup message.
set noerrorbells novisualbell t_vb= " Disable audible bell because it's annoying. set noerrorbells novisualbell t_vb= " Disable audible bell because it's annoying.
set mouse+=a " Enable mouse support set mouse+=a " Enable mouse support
@@ -31,10 +31,8 @@ set nrformats-=octal
set formatoptions+=j set formatoptions+=j
set display+=lastline set display+=lastline
set display+=truncate set display+=truncate
set history=1000
set tabpagemax=50 set tabpagemax=50
set viminfo^=! set viminfo^=!
set sessionoptions-=options
set viewoptions-=options set viewoptions-=options
set nolangremap set nolangremap
set list set list
@@ -43,9 +41,11 @@ set scrolloff=5
set isfname+={,},@-@ set isfname+={,},@-@
set updatetime=50 set updatetime=50
set noswapfile set noswapfile
set history=1000
set undofile set undofile
set undolevels=10000 set undolevels=10000
set undoreload=100000 set undoreload=100000
set sessionoptions-=options
set timeoutlen=500 set timeoutlen=500
" Vim, by default, won't let you jump to a different file without saving the " Vim, by default, won't let you jump to a different file without saving the
@@ -89,7 +89,3 @@ if !has('gui_running')
hi LineNr ctermbg=NONE guibg=NONE hi LineNr ctermbg=NONE guibg=NONE
set termguicolors set termguicolors
endif endif
" NERDTree Plugin configurations
let g:NERDTreeShowHidden = 1
let g:NERDTreeWinSize = 25

View File

@@ -38,8 +38,8 @@ vnoremap K :m '<-2<CR>gv=gv
" Better indenting " Better indenting
vnoremap < <gv vnoremap < <gv
vnoremap > >gv
xnoremap < <gv xnoremap < <gv
vnoremap > >gv
xnoremap > >gv xnoremap > >gv
" Keeps the cursor at the same place when doing J " Keeps the cursor at the same place when doing J
@@ -76,10 +76,6 @@ nnoremap <expr> N 'nN'[v:searchforward]
xnoremap <expr> N 'nN'[v:searchforward] xnoremap <expr> N 'nN'[v:searchforward]
onoremap <expr> N 'nN'[v:searchforward] onoremap <expr> N 'nN'[v:searchforward]
" Clear search highlights
nnoremap <esc> :nohlsearch<CR><esc>
inoremap <esc> :nohlsearch<CR><esc>
" <ctrl-q> to save everything and quit Neovim " <ctrl-q> to save everything and quit Neovim
nnoremap <C-q> :wqa<CR> nnoremap <C-q> :wqa<CR>
vnoremap <C-q> :wqa<CR> vnoremap <C-q> :wqa<CR>
@@ -87,12 +83,12 @@ nnoremap <C-s> :wa<CR>
vnoremap <C-s> :wa<CR> vnoremap <C-s> :wa<CR>
" Move cursor in insert mode " Move cursor in insert mode
inoremap <C-b> <ESC>^i inoremap <M-b> <ESC>^i
inoremap <C-e> <END> inoremap <M-e> <END>
inoremap <C-h> <Left> inoremap <M-h> <Left>
inoremap <C-l> <Right> inoremap <M-l> <Right>
inoremap <C-j> <Down> inoremap <M-j> <Down>
inoremap <C-k> <Up> inoremap <M-k> <Up>
" Copy entire content of the current buffer " Copy entire content of the current buffer
nnoremap <C-c> :%y+<CR> nnoremap <C-c> :%y+<CR>
@@ -103,4 +99,10 @@ nnoremap <leader>/ :nohlsearch<CR>:diffupdate<CR>:normal! <C-L><CR>
" Changes the pwd to the opened file's directory " Changes the pwd to the opened file's directory
nnoremap <leader>cd :lcd %:h<CR> nnoremap <leader>cd :lcd %:h<CR>
map <leader>j <Plug>(easymotion-s)
" Map easymotion Plugin to <Leader>j
nnoremap <leader>j <Plug>(easymotion-s)
" Show the undo tree
nnoremap <leader>u :UndotreeToggle<CR>

View File

@@ -13,6 +13,7 @@ call plug#begin('~/.vim/plugged')
Plug 'preservim/nerdtree' "Nerd Tree Plug 'preservim/nerdtree' "Nerd Tree
Plug 'tpope/vim-obsession' "Obsessions -> saves sessions Plug 'tpope/vim-obsession' "Obsessions -> saves sessions
Plug 'christoomey/vim-tmux-navigator' "Syncs with Tmux pane navigation keymaps Plug 'christoomey/vim-tmux-navigator' "Syncs with Tmux pane navigation keymaps
Plug 'mbbill/undotree' "Show the undo tree
"------------Style Plugins------------" "------------Style Plugins------------"
" Status Styles " Status Styles
Plug 'itchyny/lightline.vim' Plug 'itchyny/lightline.vim'

View File

@@ -33,9 +33,10 @@ autocmd! bufwritepost $VIMRC source %
" Save inside vim config directory " Save inside vim config directory
set undodir=$VIMDIR/undo// set undodir=$VIMDIR/undo//
" Map easymotion Plugin to <Leader>j
map <leader>j <Plug>(easymotion-s)
" Map nerdtree to <Leader>e " Map nerdtree to <Leader>e
" Changes the pwd and opens the VCS root " Changes the pwd and opens the VCS root
nnoremap <leader>e :tcd %:h<CR> :NERDTreeToggleVCS<CR> nnoremap <leader>e :tcd %:h<CR> :NERDTreeToggleVCS<CR>
" NERDTree Plugin configurations
let g:NERDTreeShowHidden = 1
let g:NERDTreeWinSize = 25