mirror of
https://github.com/pratiktri/dotfiles.git
synced 2026-02-05 00:41:44 +05:30
- 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:
1
common/.config/nvim_switch/nvchad
Submodule
1
common/.config/nvim_switch/nvchad
Submodule
Submodule common/.config/nvim_switch/nvchad added at c2ec317b1b
32
common/.config/nvim_switch/nvim_old/init.lua
Normal file
32
common/.config/nvim_switch/nvim_old/init.lua
Normal 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")
|
||||
@@ -0,0 +1,9 @@
|
||||
-- Highlight on yank
|
||||
local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true })
|
||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
group = highlight_group,
|
||||
pattern = '*',
|
||||
})
|
||||
@@ -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/"
|
||||
11
common/.config/nvim_switch/nvim_old/lua/configs/keymaps.lua
Normal file
11
common/.config/nvim_switch/nvim_old/lua/configs/keymaps.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
-- 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
|
||||
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 })
|
||||
|
||||
-- map <leader>j <Plug>(easymotion-s)
|
||||
14
common/.config/nvim_switch/nvim_old/lua/plugins.lua
Normal file
14
common/.config/nvim_switch/nvim_old/lua/plugins.lua
Normal file
@@ -0,0 +1,14 @@
|
||||
-- Keeps the plugin list that Lazy uses at one place
|
||||
return {
|
||||
-- From VIM
|
||||
{ "tpope/vim-sensible" },
|
||||
{ "tpope/vim-fugitive" },
|
||||
{ "tpope/vim-surround" },
|
||||
{ "tpope/vim-repeat" },
|
||||
{ "tpope/vim-commentary" },
|
||||
{ "rstacruz/vim-closer" },
|
||||
{ "airblade/vim-gitgutter" },
|
||||
{ "easymotion/vim-easymotion" },
|
||||
{ "tpope/vim-obsession" },
|
||||
{ "mg979/vim-visual-multi" },
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
return {
|
||||
-- TODO: Throws git pull issue when downloading through Lazy
|
||||
-- "askinsho/bufferline.nvim",
|
||||
-- dependencies = "nvim-tree/nvim-web-devicons",
|
||||
-- config = function()
|
||||
-- require("bufferline").setup({
|
||||
-- options = {
|
||||
-- indicator = { style = "underline" },
|
||||
-- }
|
||||
-- })
|
||||
|
||||
-- vim.keymap.set('n', '<tab>', ":BufferLineCycleNext<CR>")
|
||||
-- vim.keymap.set('n', '<S-tab>', ":BufferLineCyclePrev<CR>")
|
||||
-- vim.keymap.set('n', '<leader>bo', ":BufferLineCloseOthers<CR>")
|
||||
-- vim.keymap.set('n', '<leader>bp', ":BufferLinePick<CR>")
|
||||
-- end
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
return {
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
config = function ()
|
||||
require("trouble").setup({})
|
||||
end
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
local tree_config = require("nvim-treesitter.configs")
|
||||
tree_config.setup({
|
||||
auto_install = true,
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<C-space>",
|
||||
node_incremental = "<C-space>",
|
||||
scope_incremental = "<C-CR>",
|
||||
node_decremental = "<bs>",
|
||||
}
|
||||
}
|
||||
})
|
||||
end
|
||||
},
|
||||
{
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
main = "ibl",
|
||||
config = function()
|
||||
require("ibl").setup({
|
||||
indent = { char = "┆" },
|
||||
})
|
||||
end
|
||||
},
|
||||
-- { "windwp/nvim-autopairs" },
|
||||
-- {
|
||||
-- "akinsho/toggleterm.nvim",
|
||||
-- version = "*",
|
||||
-- config = function ()
|
||||
-- require("toggleterm").setup({})
|
||||
-- end
|
||||
-- },
|
||||
}
|
||||
123
common/.config/nvim_switch/nvim_old/lua/plugins/coding-lsp.lua
Normal file
123
common/.config/nvim_switch/nvim_old/lua/plugins/coding-lsp.lua
Normal file
@@ -0,0 +1,123 @@
|
||||
-- TODO: Autocompletion is a hit and miss. Way too complicated at this point
|
||||
-- TODO: Try doing LazyVim.nvim instead
|
||||
|
||||
-- TODO: Use nvim-lint for linting - newer thing
|
||||
|
||||
return {
|
||||
-- LSP Configuration
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
lazy = false,
|
||||
config = function()
|
||||
-- local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
|
||||
-- local lspconfig = require("lspconfig")
|
||||
-- lspconfig.tsserver.setup({
|
||||
-- capabilities = capabilities,
|
||||
-- })
|
||||
-- lspconfig.html.setup({
|
||||
-- capabilities = capabilities,
|
||||
-- })
|
||||
-- lspconfig.lua_ls.setup({
|
||||
-- capabilities = capabilities,
|
||||
-- })
|
||||
end
|
||||
},
|
||||
{
|
||||
-- Provides :Mason command which installs Language Servers
|
||||
"williamboman/mason.nvim",
|
||||
lazy = false,
|
||||
config = function()
|
||||
require("mason").setup()
|
||||
end
|
||||
},
|
||||
{
|
||||
-- Helps to auto install Language Servers by specifying them
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
lazy = false,
|
||||
opts = {
|
||||
auto_install = true,
|
||||
},
|
||||
config = function()
|
||||
require("mason-lspconfig").setup({})
|
||||
end
|
||||
},
|
||||
{
|
||||
-- Spawns linters, parses their outputs & reports results via nvim.diagnostic
|
||||
"mfussenegger/nvim-lint",
|
||||
event = {
|
||||
"BufReadPre",
|
||||
"BufNewFile"
|
||||
},
|
||||
config = function()
|
||||
local lint = require("lint")
|
||||
local linters = require("lint").linters
|
||||
local linterConfig = vim.fn.stdpath("config") .. "linter_configs"
|
||||
|
||||
lint.linters_by_ft = {
|
||||
json = { "jsonlint" },
|
||||
protobuf = { "buf", "codespell" },
|
||||
|
||||
text = { "vale" },
|
||||
markdown = { "vale", "markdownlint" },
|
||||
rst = { "vale" },
|
||||
|
||||
html = { "markuplint", "htmlhint" },
|
||||
|
||||
bash = { "shellcheck", "codespell" },
|
||||
shell = { "shellcheck", "codespell" },
|
||||
lua = { "compiler", "selene", "codespell" },
|
||||
luau = { "compiler", "selene", "codespell" },
|
||||
|
||||
javascript = { "eslint_d", "codespell" },
|
||||
typescript = { "eslint_d", "codespell" },
|
||||
javascriptreact = { "eslint_d", "codespell" },
|
||||
typescriptreact = { "eslint_d", "codespell" },
|
||||
|
||||
python = { "pyre", "codespell" },
|
||||
}
|
||||
|
||||
-- use for codespell for all except css
|
||||
for ft, _ in pairs(lint.linters_by_ft) do
|
||||
if ft ~= "css" then table.insert(lint.linters_by_ft[ft], "codespell") end
|
||||
end
|
||||
|
||||
linters.codespell.args = {
|
||||
"--ignore-words",
|
||||
linterConfig .. "/codespell-ignore.txt",
|
||||
"--builtin=pratik,kumar,tripathy",
|
||||
}
|
||||
|
||||
linters.shellcheck.args = {
|
||||
"--shell=bash", -- force to work with zsh
|
||||
"--format=json",
|
||||
"-",
|
||||
}
|
||||
|
||||
linters.yamllint.args = {
|
||||
"--config-file",
|
||||
linterConfig .. "/yamllint.yaml",
|
||||
"--format=parsable",
|
||||
"-",
|
||||
}
|
||||
|
||||
linters.markdownlint.args = {
|
||||
"--disable=no-trailing-spaces", -- not disabled in config, so it's enabled for formatting
|
||||
"--disable=no-multiple-blanks",
|
||||
"--config=" .. linterConfig .. "/markdownlint.yaml",
|
||||
}
|
||||
|
||||
local lint_group = vim.api.nvim_create_augroup("lint", { clear = true })
|
||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
||||
group = lint_group,
|
||||
callback = function ()
|
||||
lint.try_lint()
|
||||
end,
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>ll", function ()
|
||||
lint.try_lint()
|
||||
end, { desc = "Lint current file" })
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
return {
|
||||
{
|
||||
"theprimeagen/refactoring.nvim"
|
||||
},
|
||||
}
|
||||
@@ -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
|
||||
},
|
||||
}
|
||||
21
common/.config/nvim_switch/nvim_old/lua/plugins/lualine.lua
Normal file
21
common/.config/nvim_switch/nvim_old/lua/plugins/lualine.lua
Normal file
@@ -0,0 +1,21 @@
|
||||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
config = function()
|
||||
local lazy_status = require("lazy.status")
|
||||
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
-- theme = "horizon",
|
||||
-- TODO: Following ain't taking effect. Why?
|
||||
sections = {
|
||||
lualine_a = {'mode','filename'},
|
||||
lualine_b = {'branch'},
|
||||
lualine_c = {'diff', 'diagnostics'},
|
||||
lualine_x = { { lazy_status.updates, cond = lazy_status.has_updates } },
|
||||
lualine_y = {'progress'},
|
||||
lualine_z = {'location', 'searchcount'}
|
||||
},
|
||||
}
|
||||
})
|
||||
end
|
||||
}
|
||||
50
common/.config/nvim_switch/nvim_old/lua/plugins/neo-tree.lua
Normal file
50
common/.config/nvim_switch/nvim_old/lua/plugins/neo-tree.lua
Normal file
@@ -0,0 +1,50 @@
|
||||
return {
|
||||
{
|
||||
"airblade/vim-rooter",
|
||||
config = function()
|
||||
vim.g.rooter_cd_cmd = "tcd"
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
config = function()
|
||||
require("neo-tree").setup({
|
||||
filesystem = {
|
||||
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 = 25, -- 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 = 1, -- Compact tree display
|
||||
padding = 0, -- Compact tree display
|
||||
},
|
||||
},
|
||||
})
|
||||
-- Keymaps for Neotree
|
||||
vim.keymap.set("n", "<Leader>e", ":Neotree filesystem toggle<CR>")
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
return {
|
||||
{
|
||||
"nvim-telescope/telescope.nvim", tag = "0.1.5",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"neovim/nvim-lspconfig",
|
||||
"nvim-tree/nvim-web-devicons"
|
||||
},
|
||||
config = function()
|
||||
local actions = require("telescope.actions")
|
||||
|
||||
require("telescope").setup({
|
||||
pickers = {
|
||||
find_files = {
|
||||
mappings = {
|
||||
i = {
|
||||
-- Ctrl + s to open in horizontal split
|
||||
["<C-s>"] = actions.select_horizontal
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
require("telescope").load_extension("fzf")
|
||||
|
||||
-- Keymaps for Telescope
|
||||
local builtin = require("telescope.builtin")
|
||||
vim.keymap.set("n", "<leader>ff", "<cmd>lua require'telescope.builtin'.find_files({ find_command = {'rg', '--files', '--hidden', '-g', '!{**/.git/*,**/node_modules/*,**/package-lock.json,**/yarn.lock}' }})<cr>", {})
|
||||
-- TODO: Live grep ain't working
|
||||
-- vim.keymap.set("n", "<Leader>fl", builtin.live_grep, {})
|
||||
vim.keymap.set("n", "<Leader>fm", builtin.marks, {})
|
||||
vim.keymap.set("n", "<Leader>fc", builtin.colorscheme, {})
|
||||
vim.keymap.set("n", "<Leader>fr", builtin.registers, {})
|
||||
vim.keymap.set("n", "<Leader>fs", builtin.lsp_document_symbols, {})
|
||||
vim.keymap.set("n", "<Leader>fw", builtin.grep_string, {})
|
||||
vim.keymap.set("n", "<Leader>fg", "<cmd>AdvancedGitSearch<CR>", {})
|
||||
vim.keymap.set("n", "<Leader>ft", builtin.treesitter, {})
|
||||
-- TODO: Find TODO ain't working either
|
||||
vim.keymap.set("n", "<Leader>fd", ":TodoTelescope<CR>", {})
|
||||
end
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build'
|
||||
},
|
||||
{
|
||||
-- For displaying LSP Code Actions
|
||||
"nvim-telescope/telescope-ui-select.nvim",
|
||||
config = function()
|
||||
require("telescope").setup({
|
||||
extensions = {
|
||||
["ui-select"] = {
|
||||
require("telescope.themes").get_dropdown{
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
require("telescope").load_extension("ui-select")
|
||||
end
|
||||
},
|
||||
{
|
||||
"aaronhallaert/advanced-git-search.nvim",
|
||||
config = function()
|
||||
require("telescope").load_extension("advanced_git_search")
|
||||
end
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
return {
|
||||
"folke/todo-comments.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
require("todo-comments").setup({})
|
||||
|
||||
vim.keymap.set("n", "]t", function()
|
||||
require("todo-comments").jump_next()
|
||||
end, { desc = "Next todo comment" }
|
||||
)
|
||||
vim.keymap.set("n", "[t", function()
|
||||
require("todo-comments").jump_prev()
|
||||
end, { desc = "Previous todo comment" }
|
||||
)
|
||||
end
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
return{
|
||||
"mbbill/undotree",
|
||||
config = function()
|
||||
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
|
||||
end
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
return {
|
||||
"christoomey/vim-tmux-navigator",
|
||||
lazy = false,
|
||||
config = function()
|
||||
|
||||
end
|
||||
}
|
||||
Reference in New Issue
Block a user