- 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

@@ -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
}

View File

@@ -0,0 +1,8 @@
return {
{
"folke/trouble.nvim",
config = function ()
require("trouble").setup({})
end
},
}

View File

@@ -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
-- },
}

View 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,
},
}

View File

@@ -0,0 +1,5 @@
return {
{
"theprimeagen/refactoring.nvim"
},
}

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

@@ -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
}

View 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,
},
}

View File

@@ -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
}
}

View File

@@ -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
}

View File

@@ -0,0 +1,6 @@
return{
"mbbill/undotree",
config = function()
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
end
}

View File

@@ -0,0 +1,7 @@
return {
"christoomey/vim-tmux-navigator",
lazy = false,
config = function()
end
}