added stow

This commit is contained in:
Kulvir Singh
2024-09-26 02:39:46 +05:30
parent b797d082e1
commit 8c703b74f8
81 changed files with 453 additions and 689 deletions

56
.config/nvim/init.lua Normal file
View File

@@ -0,0 +1,56 @@
--[[
=====================================================================
==================== READ THIS BEFORE CONTINUING ====================
=====================================================================
======== .-----. ========
======== .----------------------. | === | ========
======== |.-""""""""""""""""""-.| |-----| ========
======== || || | === | ========
======== || KICKSTART.NVIM || |-----| ========
======== || || | === | ========
======== || || |-----| ========
======== ||:Tutor || |:::::| ========
======== |'-..................-'| |____o| ========
======== `"")----------------(""` ___________ ========
======== /::::::::::| |::::::::::\ \ no mouse \ ========
======== /:::========| |==hjkl==:::\ \ required \ ========
======== '""""""""""""' '""""""""""""' '""""""""""' ========
======== ========
=====================================================================
=====================================================================
I hope you enjoy your Neovim journey,
- TJ
--]]
vim.g.mapleader = " "
vim.g.maplocalleader = " "
-- netrw settings
vim.g.netrw_banner = 0
vim.g.netrw_browse_split = 0
vim.g.netrw_winsize = 25
vim.g.have_nerd_font = true
local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
vim.fn.system {
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
}
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({ import = "lilJ/plugins" }, {
change_detection = {
notify = false,
},
})
-- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et

View File

@@ -0,0 +1,44 @@
{
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
"LuaSnip": { "branch": "master", "commit": "de1a287c9cb525ae52bc846e8f6207e5ef1da5ac" },
"SchemaStore.nvim": { "branch": "main", "commit": "de73a884679a2461c53f96035894ef073a5a7f4f" },
"catpuccin": { "branch": "main", "commit": "d97387aea8264f484bb5d5e74f2182a06c83e0d8" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"conform.nvim": { "branch": "master", "commit": "00f9d91391b04b1935e2f15948bd96cc111e7d3a" },
"fidget.nvim": { "branch": "main", "commit": "ef99df04a1c53a453602421bc0f756997edc8289" },
"friendly-snippets": { "branch": "main", "commit": "dd2fd1281d4b22e7b4a5bfafa3e142d958e251f2" },
"gitsigns.nvim": { "branch": "main", "commit": "805610a9393fa231f2c2b49cb521bfa413fadb3d" },
"indent-blankline.nvim": { "branch": "master", "commit": "ece00d5fb44d196680a81fd2761062d2fa44663b" },
"lazy.nvim": { "branch": "main", "commit": "c501b429cf995c645454539b924aaefae45bb9eb" },
"lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "a4caa0d083aab56f6cd5acf2d42331b74614a585" },
"mason-nvim-dap.nvim": { "branch": "main", "commit": "67210c0e775adec55de9826b038e8b62de554afc" },
"mason-tool-installer.nvim": { "branch": "main", "commit": "c1fbdcb0d8d1295314f1612c4a247253e70299d9" },
"mason.nvim": { "branch": "main", "commit": "49ff59aded1047a773670651cfa40e76e63c6377" },
"mini.nvim": { "branch": "main", "commit": "eb2dd6d187e1ab5fefec66f0d37b1a3dc8633d17" },
"neodev.nvim": { "branch": "main", "commit": "ce9a2e8eaba5649b553529c5498acb43a6c317cd" },
"nvim-cmp": { "branch": "main", "commit": "5260e5e8ecadaf13e6b82cf867a909f54e15fd07" },
"nvim-dap": { "branch": "master", "commit": "5a2f7121869394502521c52b2bc581ab22c69447" },
"nvim-dap-go": { "branch": "main", "commit": "5faf165f5062187320eaf9d177c3c1f647adc22e" },
"nvim-dap-python": { "branch": "master", "commit": "7c427e2bbc72d46ea3c9602bede6465ef61b8c19" },
"nvim-dap-ui": { "branch": "master", "commit": "71bfe9bd6b3465e169b53bea4f83775034d822dd" },
"nvim-dap-virtual-text": { "branch": "master", "commit": "3e8e207513e6ef520894950acd76b79902714103" },
"nvim-lint": { "branch": "master", "commit": "1f98d6c863f91706369d74aeb2eb3f02b2e96861" },
"nvim-lspconfig": { "branch": "master", "commit": "9bda20fb967075355f253911bc066a8b5a03c77e" },
"nvim-nio": { "branch": "master", "commit": "8765cbc4d0c629c8158a5341e1b4305fd93c3a90" },
"nvim-tmux-navigation": { "branch": "main", "commit": "4898c98702954439233fdaf764c39636681e2861" },
"nvim-treesitter": { "branch": "master", "commit": "7c9c5bed8340031f8a6dad47a58a26eaf15b9a56" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "5f9bf4b1ead7707e4e74e5319ee56bdc81fb73db" },
"nvim-web-devicons": { "branch": "master", "commit": "e37bb1feee9e7320c76050a55443fa843b4b6f83" },
"plenary.nvim": { "branch": "master", "commit": "b5c8de02a44ffeabff678090edd6a132ff8ab77d" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" },
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
"telescope.nvim": { "branch": "0.1.x", "commit": "d829aa64059001ee7b2c8c8aa9c4e6df0b17d893" },
"todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" },
"vim-dadbod": { "branch": "master", "commit": "37523ffe0849b51db07fa7f48430c2aca5420a0e" },
"vim-dadbod-completion": { "branch": "master", "commit": "5d5ad196fcde223509d7dabbade0148f7884c5e3" },
"vim-dadbod-ui": { "branch": "master", "commit": "49dabb8717a43d757faaa0ceaadc8ee060709422" }
}

View File

@@ -0,0 +1,82 @@
local luasnip = require "luasnip"
luasnip.config.setup {
history = false,
updateevents = "TextChanged,TextChangedI",
}
require("luasnip.loaders.from_vscode").lazy_load()
local lspkind = require "lspkind"
lspkind.init {}
local cmp = require "cmp"
cmp.setup {
window = {
documentation = {
border = "rounded",
},
completion = {
border = "rounded",
},
},
sources = {
{ name = "nvim_lsp" },
{ name = "path" },
{ name = "buffer" },
},
completion = {
completeopt = "menu, menuone, noinsert, noselect",
},
formatting = {
fields = { "kind", "abbr", "menu" },
expandable_indicator = true,
format = lspkind.cmp_format {
mode = "symbol",
},
},
-- No, but seriously. Please read `:help ins-completion`, it is really good!
mapping = cmp.mapping.preset.insert {
["<C-n>"] = cmp.mapping.select_next_item(),
["<C-p>"] = cmp.mapping.select_prev_item(),
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-y>"] = cmp.mapping.confirm { select = true },
["<C-Space>"] = cmp.mapping.complete {},
-- Think of <c-l> as moving to the right of your snippet expansion.
-- So if you have a snippet that's like:
-- function $name($args)
-- $body
-- end
--
-- <c-l> will move you to the right of each of the expansion locations.
-- <c-h> is similar, except moving you backwards.
["<C-l>"] = cmp.mapping(function()
if luasnip.expand_or_locally_jumpable() then
luasnip.expand_or_jump()
end
end, { "i", "s" }),
["<C-h>"] = cmp.mapping(function()
if luasnip.locally_jumpable(-1) then
luasnip.jump(-1)
end
end, { "i", "s" }),
},
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
},
}
cmp.setup.filetype({ "sql" }, {
sources = {
{ name = "vim-dadbod-completion" },
{ name = "buffer" },
},
})

View File

@@ -0,0 +1,52 @@
--[[
--
-- This file is not required for your own configuration,
-- but helps people determine if their system is setup correctly.
--
--]]
local check_version = function()
local verstr = string.format("%s.%s.%s", vim.version().major, vim.version().minor, vim.version().patch)
if not vim.version.cmp then
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr))
return
end
if vim.version.cmp(vim.version(), { 0, 9, 4 }) >= 0 then
vim.health.ok(string.format("Neovim version is: '%s'", verstr))
else
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr))
end
end
local check_external_reqs = function()
-- Basic utils: `git`, `make`, `unzip`
for _, exe in ipairs({ "git", "make", "unzip", "rg" }) do
local is_executable = vim.fn.executable(exe) == 1
if is_executable then
vim.health.ok(string.format("Found executable: '%s'", exe))
else
vim.health.warn(string.format("Could not find executable: '%s'", exe))
end
end
return true
end
return {
check = function()
vim.health.start("kickstart.nvim")
vim.health.info([[NOTE: Not every warning is a 'must-fix' in `:checkhealth`
Fix only warnings for plugins and languages you intend to use.
Mason will give warnings for languages that are not installed.
You do not need to install, unless you want to use those languages!]])
local uv = vim.uv or vim.loop
vim.health.info("System Information: " .. vim.inspect(uv.os_uname()))
check_version()
check_external_reqs()
end,
}

View File

@@ -0,0 +1,28 @@
return {
"EdenEast/nightfox.nvim",
lazy = false,
priority = 1000,
init = function()
require("nightfox").setup {
transparent_background = true,
}
vim.cmd.colorscheme "carbonfox"
vim.cmd.hi "Comment gui=none"
vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
vim.api.nvim_set_hl(0, "NormalNC", { bg = "none" })
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
border = "rounded",
})
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
border = "rounded",
})
vim.diagnostic.config {
float = { border = "rounded" },
}
end,
}

View File

@@ -0,0 +1,28 @@
return {
-- "catppuccin/nvim",
-- name = "catpuccin",
-- priority = 1000,
-- lazy = false,
-- init = function()
-- require("catppuccin").setup {
-- transparent_background = true,
-- }
-- vim.cmd.colorscheme "catppuccin"
--
-- vim.cmd.hi "Comment gui=none"
-- vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
-- vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
--
-- vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
-- border = "rounded",
-- })
--
-- vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
-- border = "rounded",
-- })
--
-- vim.diagnostic.config {
-- float = { border = "rounded" },
-- }
-- end,
}

View File

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

View File

@@ -0,0 +1,27 @@
return {
"hrsh7th/nvim-cmp",
event = "InsertEnter",
dependencies = {
"onsails/lspkind.nvim",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-path",
"hrsh7th/cmp-buffer",
{
"L3MON4D3/LuaSnip",
build = "make install_jsregexp",
dependencies = {
-- https://github.com/rafamadriz/friendly-snippets
{
"rafamadriz/friendly-snippets",
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
end,
},
},
},
"saadparwaiz1/cmp_luasnip",
},
config = function()
require "lilJ.completions"
end,
}

View File

@@ -0,0 +1,22 @@
return {
"stevearc/conform.nvim",
opts = {
notify_on_error = false,
format_on_save = function(bufnr)
local disable_filetypes = {}
return {
timeout_ms = 500,
lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype],
}
end,
formatters_by_ft = {
c = { "clang-format" },
css = { "prettier" },
go = { "gofumpt", "goimports_reviser" },
html = { "prettier" },
lua = { "stylua" },
typescript = { "prettier" },
typescriptreact = { "prettier" },
},
},
}

View File

@@ -0,0 +1,5 @@
return {
"tpope/vim-dadbod",
"kristijanhusak/vim-dadbod-completion",
"kristijanhusak/vim-dadbod-ui",
}

View File

@@ -0,0 +1,89 @@
-- debug.lua
-- Shows how to use the DAP plugin to debug your code.
--
-- Primarily focused on configuring the debugger for Go, but can
-- be extended to other languages as well. That's why it's called
-- kickstart.nvim and not kitchen-sink.nvim ;)
return {
"mfussenegger/nvim-dap",
dependencies = {
"rcarriga/nvim-dap-ui",
"nvim-neotest/nvim-nio",
"theHamsta/nvim-dap-virtual-text",
"williamboman/mason.nvim",
"jay-babu/mason-nvim-dap.nvim",
-- GO DEBUG
"leoluz/nvim-dap-go",
"mfussenegger/nvim-dap-python",
},
config = function()
local dap = require "dap"
local ui = require "dapui"
require("dapui").setup()
require("dap-go").setup()
require("nvim-dap-virtual-text").setup {
-- This just tries to mitigate the chance that I leak tokens here. Probably won't stop it from happening...
-- But I am not a streamer, so I may not want this, or prolly change it in future, but rn its commented
--
-- display_callback = function(variable)
-- local name = string.lower(variable.name)
-- local value = string.lower(variable.value)
-- if name:match "secret" or name:match "api" or value:match "secret" or value:match "api" then
-- return "*****"
-- end
--
-- if #variable.value > 15 then
-- return " " .. string.sub(variable.value, 1, 15) .. "... "
-- end
--
-- return " " .. variable.value
-- end,
}
require("mason-nvim-dap").setup {
automatic_setup = true,
automatic_installation = true,
handlers = {},
ensure_installed = {
"debugpy",
"delve",
},
}
vim.keymap.set("n", "<leader>dt", dap.toggle_breakpoint, { desc = "Debug: Toggle Breakpoint" })
vim.keymap.set("n", "<Space>?", function()
require("dapui").eval(nil, { enter = true })
end)
-- Basic debugging keymaps, feel free to change to your liking!
vim.keymap.set("n", "<F5>", dap.continue, { desc = "Start/Continue" })
vim.keymap.set("n", "<F4>", dap.step_into, { desc = "Step Into" })
vim.keymap.set("n", "<F3>", dap.step_over, { desc = "Step Over" })
vim.keymap.set("n", "<F2>", dap.step_out, { desc = "Step Out" })
vim.keymap.set("n", "<F1>", dap.step_back, { desc = "Step Back" })
vim.keymap.set("n", "<F10>", dap.restart, { desc = "Restart" })
dap.listeners.before.attach.dapui_config = function()
ui.open()
end
dap.listeners.before.launch.dapui_config = function()
ui.open()
end
dap.listeners.before.event_terminated.dapui_config = function()
ui.close()
end
dap.listeners.before.event_exited.dapui_config = function()
ui.close()
end
require("dap-go").setup()
require("dap-python").setup "~/.local/share/nvim/mason/packages/debugpy/venv/bin/python"
end,
}

View File

@@ -0,0 +1,14 @@
return {
"lewis6991/gitsigns.nvim",
event = { "BufReadPre", "BufNewFile" },
opts = {
signs = {
add = { text = "+" },
change = { text = "~" },
delete = { text = "_" },
topdelete = { text = "" },
changedelete = { text = "~" },
untracked = { text = "" },
},
},
}

View File

@@ -0,0 +1,10 @@
return {
{
"lukas-reineke/indent-blankline.nvim",
main = "ibl",
opts = {
indent = { char = "" },
whitespace = { highlight = { "Whitespace", "NonText" } },
},
},
}

View File

@@ -0,0 +1,46 @@
return {
{
"mfussenegger/nvim-lint",
event = { "BufReadPre", "BufNewFile" },
config = function()
local lint = require "lint"
lint.linters_by_ft = {
python = { "ruff", "mypy" },
dockerfile = { "hadolint" },
json = { "jsonlint" },
markdown = { "vale" },
text = { "vale" },
}
-- To allow other plugins to add linters to require('lint').linters_by_ft,
-- instead set linters_by_ft like this:
-- lint.linters_by_ft = lint.linters_by_ft or {}
-- lint.linters_by_ft['markdown'] = { 'markdownlint' }
--
-- However, note that this will enable a set of default linters,
-- which will cause errors unless these tools are available:
-- {
-- dockerfile = { "hadolint" },
-- json = { "jsonlint" },
-- markdown = { "vale" },
-- text = { "vale" }
-- }
--
-- You can disable the default linters by setting their filetypes to nil:
-- lint.linters_by_ft['dockerfile'] = nil
-- lint.linters_by_ft['json'] = nil
-- lint.linters_by_ft['text'] = nil
-- Create autocommand which carries out the actual linting
-- on the specified events.
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
group = lint_augroup,
callback = function()
require("lint").try_lint()
end,
})
end,
},
}

View File

@@ -0,0 +1,158 @@
return {
"neovim/nvim-lspconfig",
dependencies = {
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
"WhoIsSethDaniel/mason-tool-installer.nvim",
{ "j-hui/fidget.nvim", opts = {} },
{ "folke/neodev.nvim", opts = {} },
"b0o/SchemaStore.nvim",
},
config = function()
local capabilities = nil
if pcall(require, "cmp_nvim_lsp") then
capabilities = require("cmp_nvim_lsp").default_capabilities()
end
-- Enable the following language servers
local servers = {
clangd = {},
gopls = {
filetypes = { "go", "gomod", "gowork", "gotmpl" },
},
html = {
filetypes = { "html", "tmpl" },
},
jsonls = {
settings = {
json = {
schemas = require("schemastore").json.schemas(),
validate = { enable = true },
},
},
},
lua_ls = {
-- cmd = {...},
-- filetypes = { ...},
-- capabilities = {},
settings = {
Lua = {
completion = {
callSnippet = "Replace",
},
-- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings
-- diagnostics = { disable = { 'missing-fields' } },
},
},
},
pyright = {},
ts_ls = {},
tailwindcss = {
filetypes = { "html", "css", "typescript", "typescriptreact" },
},
}
require("mason").setup()
local ensure_installed = vim.tbl_keys(servers or {})
vim.list_extend(ensure_installed, {
"clang-format",
"gofumpt",
"goimports-reviser",
"hadolint",
"jsonlint",
"mypy",
"prettier",
"ruff",
"stylua",
"vale",
})
require("mason-tool-installer").setup { ensure_installed = ensure_installed }
require("mason-lspconfig").setup {
handlers = {
function(server_name)
local server = servers[server_name] or {}
server.capabilities = vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {})
require("lspconfig")[server_name].setup(server)
end,
},
}
local signs = { Error = "", Warn = "", Hint = "󰠠 ", Info = "" }
for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
end
vim.api.nvim_create_autocmd("LspAttach", {
group = vim.api.nvim_create_augroup("kickstart-lsp-attach", { clear = true }),
callback = function(event)
local map = function(keys, func, desc)
vim.keymap.set("n", keys, func, { buffer = event.buf, desc = "LSP: " .. desc })
end
-- Jump to the definition of the word under your cursor.
-- This is where a variable was first declared, or where a function is defined, etc.
-- To jump back, press <C-t>.
map("gd", require("telescope.builtin").lsp_definitions, "[G]oto [D]efinition")
-- Find references for the word under your cursor.
map("gr", require("telescope.builtin").lsp_references, "[G]oto [R]eferences")
-- Jump to the implementation of the word under your cursor.
-- Useful when your language has ways of declaring types without an actual implementation.
map("gI", require("telescope.builtin").lsp_implementations, "[G]oto [I]mplementation")
-- Jump to the type of the word under your cursor.
-- Useful when you're not sure what type a variable is and you want to see
-- the definition of its *type*, not where it was *defined*.
map("<leader>D", require("telescope.builtin").lsp_type_definitions, "Type [D]efinition")
-- Fuzzy find all the symbols in your current document.
-- Symbols are things like variables, functions, types, etc.
map("<leader>ds", require("telescope.builtin").lsp_document_symbols, "[D]ocument [S]ymbols")
-- Fuzzy find all the symbols in your current workspace.
-- Similar to document symbols, except searches over your entire project.
map("<leader>ws", require("telescope.builtin").lsp_dynamic_workspace_symbols, "[W]orkspace [S]ymbols")
-- Rename the variable under your cursor.
-- Most Language Servers support renaming across files, etc.
map("<leader>rn", vim.lsp.buf.rename, "[R]e[n]ame")
-- Execute a code action, usually your cursor needs to be on top of an error
-- or a suggestion from your LSP for this to activate.
map("<leader>ca", vim.lsp.buf.code_action, "[C]ode [A]ction")
-- Opens a popup that displays documentation about the word under your cursor
-- See `:help K` for why this keymap.
map("K", vim.lsp.buf.hover, "Hover Documentation")
-- WARN: This is not Goto Definition, this is Goto Declaration.
-- For example, in C this would take you to the header.
map("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration")
-- The following two autocommands are used to highlight references of the
-- word under your cursor when your cursor rests there for a little while.
local client = vim.lsp.get_client_by_id(event.data.client_id)
if client and client.server_capabilities.documentHighlightProvider then
vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
buffer = event.buf,
callback = vim.lsp.buf.document_highlight,
})
vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, {
buffer = event.buf,
callback = vim.lsp.buf.clear_references,
})
end
end,
})
end,
}

View File

@@ -0,0 +1,29 @@
return {
"echasnovski/mini.nvim",
config = function()
-- Better Around/Inside textobjects
--
-- Examples:
-- - va) - [V]isually select [A]round [)]paren
-- - yinq - [Y]ank [I]nside [N]ext [']quote
-- - ci' - [C]hange [I]nside [']quote
require("mini.ai").setup { n_lines = 500 }
-- Add/delete/replace surroundings (brackets, quotes, etc.)
--
-- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren
-- - sd' - [S]urround [D]elete [']quotes
-- - sr)' - [S]urround [R]eplace [)] [']
require("mini.surround").setup()
local statusline = require "mini.statusline"
statusline.setup { use_icons = vim.g.have_nerd_font }
---@diagnostic disable-next-line: duplicate-set-field
statusline.section_location = function()
return "%2l:%-2v"
end
-- Check out: https://github.com/echasnovski/mini.nvim
end,
}

View File

@@ -0,0 +1,24 @@
return {
"nvim-telescope/telescope.nvim",
event = "VimEnter",
branch = "0.1.x",
dependencies = {
"nvim-lua/plenary.nvim",
{
"nvim-telescope/telescope-fzf-native.nvim",
build = "make",
cond = function()
return vim.fn.executable "make" == 1
end,
},
{ "nvim-telescope/telescope-ui-select.nvim" },
{ "nvim-tree/nvim-web-devicons", enabled = vim.g.have_nerd_font },
},
config = function()
require "lilJ.telescope"
end,
}

View File

@@ -0,0 +1,20 @@
return {
"alexghergh/nvim-tmux-navigation",
lazy = false,
config = function()
local nvim_tmux_nav = require "nvim-tmux-navigation"
nvim_tmux_nav.setup {
disable_when_zoomed = true,
}
vim.keymap.set("n", "<C-h>", nvim_tmux_nav.NvimTmuxNavigateLeft)
vim.keymap.set("n", "<C-j>", nvim_tmux_nav.NvimTmuxNavigateDown)
vim.keymap.set("n", "<C-k>", nvim_tmux_nav.NvimTmuxNavigateUp)
vim.keymap.set("n", "<C-l>", nvim_tmux_nav.NvimTmuxNavigateRight)
vim.keymap.set("n", "<C-space>", nvim_tmux_nav.NvimTmuxNavigateLastActive)
vim.keymap.set("n", "<C-//>", nvim_tmux_nav.NvimTmuxNavigateNext)
end,
}

View File

@@ -0,0 +1,6 @@
return {
"folke/todo-comments.nvim",
event = "VimEnter",
dependencies = { "nvim-lua/plenary.nvim" },
opts = { signs = false },
}

View File

@@ -0,0 +1,20 @@
return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
dependencies = {
"nvim-treesitter/nvim-treesitter-textobjects",
},
opts = {
ensure_installed = { "c", "go", "html", "lua", "python", "typescript", "tsx" },
auto_install = true,
highlight = {
enable = true,
additional_vim_regex_highlighting = { "ruby" },
},
indent = { enable = true, disable = { "ruby" } },
},
config = function(_, opts)
---@diagnostic disable-next-line: missing-fields
require("nvim-treesitter.configs").setup(opts)
end,
}

View File

@@ -0,0 +1,68 @@
-- Telescope is a fuzzy finder that comes with a lot of different things that
-- it can fuzzy find! It's more than just a "file finder", it can search
-- many different aspects of Neovim, your workspace, LSP, and more!
--
-- Two important keymaps to use while in Telescope are:
-- - Insert mode: <c-/>
-- - Normal mode: ?
--
-- This opens a window that shows you all of the keymaps for the current
-- Telescope picker. This is really useful to discover what Telescope can
-- do as well as how to actually do it!
require("telescope").setup {
defaults = {
file_ignore_patterns = { ".git/", "node%_modules/.*" },
prompt_prefix = "🔭 ",
selection_caret = "",
-- initial_mode = "normal",
},
extensions = {
["ui-select"] = {
require("telescope.themes").get_dropdown(),
},
fzf = {},
wrap_results = true,
},
}
-- Enable Telescope extensions if they are installed
pcall(require("telescope").load_extension, "fzf")
pcall(require("telescope").load_extension, "ui-select")
local builtin = require "telescope.builtin"
vim.keymap.set("n", "<leader>sf", builtin.find_files, { desc = "[S]earch [F]iles" })
vim.keymap.set("n", "<leader>sh", builtin.help_tags, { desc = "[S]earch [H]elp" })
vim.keymap.set("n", "<leader>sk", builtin.keymaps, { desc = "[S]earch [K]eymaps" })
vim.keymap.set("n", "<leader>ss", builtin.builtin, { desc = "[S]earch [S]elect Telescope" })
-- IDK how to make grep work on my machine... (skill issues tbh)
vim.keymap.set("n", "<leader>sw", builtin.grep_string, { desc = "[S]earch current [W]ord" })
vim.keymap.set("n", "<leader>sg", builtin.live_grep, { desc = "[S]earch by [G]rep" })
vim.keymap.set("n", "<leader>sd", builtin.diagnostics, { desc = "[S]earch [D]iagnostics" })
vim.keymap.set("n", "<leader>sr", builtin.resume, { desc = "[S]earch [R]esume" })
vim.keymap.set("n", "<leader>s.", builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
vim.keymap.set("n", "<leader><leader>", builtin.buffers, { desc = "[ ] Find existing buffers" })
-- Slightly advanced example of overriding default behavior and theme
vim.keymap.set("n", "<leader>/", function()
builtin.current_buffer_fuzzy_find(require("telescope.themes").get_dropdown {
winblend = 50,
previewer = false,
})
end, { desc = "[/] Fuzzily search in current buffer" })
vim.keymap.set("n", "<leader>s/", function()
builtin.live_grep {
grep_open_files = true,
prompt_title = "Live Grep in Open Files",
}
end, { desc = "[S]earch [/] in Open Files" })
-- Shortcut for searching your Neovim configuration files
vim.keymap.set("n", "<leader>sn", function()
builtin.find_files { cwd = vim.fn.stdpath "config" }
end, { desc = "[S]earch [N]eovim files" })

View File

@@ -0,0 +1,54 @@
local set = vim.keymap.set
-- Prevent continue comment on new line
vim.api.nvim_create_autocmd(
"FileType",
{ pattern = "*", command = [[setlocal formatoptions-=c formatoptions-=r formatoptions-=o]] }
)
vim.opt.wildignore = "*/.git/*,*/.DS_Store/*,*/target/*,*/node_modules/*"
vim.opt.expandtab = true
-- stay in indent mode only
set("v", "<", "<gv")
set("v", ">", ">gv")
-- Move lines by selecting
set("v", "J", ":m '>+1<CR>gv=gv")
set("v", "K", ":m '<-2<CR>gv=gv")
-- Keep yaa head straight
set("n", "<C-d>", "<C-d>zz")
set("n", "<C-u>", "<C-u>zz")
-- Navigate with Netrw
set("n", "<leader>n", vim.cmd.Ex, { desc = "Open [N]etrw" })
-- Prime said this is greatest remap ever
set("x", "<leader>p", [["_dP]])
-- Next greatest reamap
set({ "n", "v" }, "<leader>d", [["_d]])
-- Set highlight on search, but clear on pressing <Esc> in normal mode
vim.opt.hlsearch = true
set("n", "<Esc>", "<cmd>nohlsearch<CR>")
-- Diagnostic keymaps
set("n", "[d", vim.diagnostic.goto_prev, { desc = "Go to previous [D]iagnostic message" })
set("n", "]d", vim.diagnostic.goto_next, { desc = "Go to next [D]iagnostic message" })
set("n", "<leader>q", vim.diagnostic.setloclist, { desc = "Open diagnostic [Q]uickfix list" })
set("n", "<leader>e", vim.diagnostic.open_float, { desc = "Show diagnostic [E]rror messages" })
-- Disable arrow keys in normal mode
set("n", "<left>", '<cmd>echo "Use h to move!!"<CR>')
set("n", "<right>", '<cmd>echo "Use l to move!!"<CR>')
set("n", "<up>", '<cmd>echo "Use k to move!!"<CR>')
set("n", "<down>", '<cmd>echo "Use j to move!!"<CR>')
-- Highlight when yanking (copying) text
vim.api.nvim_create_autocmd("TextYankPost", {
desc = "Highlight when yanking (copying) text",
group = vim.api.nvim_create_augroup("highlight-yank", { clear = true }),
callback = function()
vim.highlight.on_yank()
end,
})

View File

@@ -0,0 +1,47 @@
local opt = vim.opt
-- Use 4 space tabs
opt.tabstop = 4
opt.softtabstop = 4
opt.shiftwidth = 4
opt.number = true
opt.relativenumber = true
-- Don't show the mode, since it's already in the status line
opt.showmode = false
-- Sync clipboard between OS and Neovim.
opt.clipboard = "unnamedplus"
opt.breakindent = true
-- Sets how neovim will display certain whitespace characters in the editor.
-- opt.list = true
-- opt.listchars = { tab = "» ", trail = "·", nbsp = "␣" }
-- Save undo history
opt.undofile = true
-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term
opt.ignorecase = true
opt.smartcase = true
opt.signcolumn = "yes"
opt.updatetime = 250
-- Preview substitutions live, as you type!
opt.inccommand = "split"
-- Show which line your cursor is on
opt.cursorline = true
-- Minimal number of screen lines to keep above and below the cursor.
opt.scrolloff = 10
-- line wrap settings
vim.o.linebreak = true
vim.o.wrap = true
vim.o.breakindent = true
vim.o.showbreak = ""

View File

@@ -0,0 +1,23 @@
local set = vim.opt_local
-- Set local settings for terminal buffers
vim.api.nvim_create_autocmd("TermOpen", {
group = vim.api.nvim_create_augroup("custom-term-open", {}),
callback = function()
set.number = false
set.relativenumber = false
set.scrolloff = 0
end,
})
-- Easily hit escape in terminal mode.
vim.keymap.set("t", "<esc><esc>", "<c-\\><c-n>")
-- Open a terminal at the bottom of the screen with a fixed height.
vim.keymap.set("n", "<leader>st", function()
vim.cmd.new()
vim.cmd.wincmd "J"
vim.api.nvim_win_set_height(0, 12)
vim.wo.winfixheight = true
vim.cmd.term()
end)

3
.config/nvim/stylua.toml Normal file
View File

@@ -0,0 +1,3 @@
indent_type = "Spaces"
indent_width = 4
no_call_parentheses = true