moved config files to single location
This commit is contained in:
@@ -1,55 +0,0 @@
|
||||
--[[
|
||||
|
||||
=====================================================================
|
||||
==================== 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
|
||||
@@ -1,43 +0,0 @@
|
||||
{
|
||||
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
|
||||
"LuaSnip": { "branch": "master", "commit": "b152822e1a4bafb6bdf11a16cc26525cbd95ee00" },
|
||||
"SchemaStore.nvim": { "branch": "main", "commit": "8706b99e1253f54f640fbc4f4ae13cdf034c135a" },
|
||||
"catpuccin": { "branch": "main", "commit": "d97387aea8264f484bb5d5e74f2182a06c83e0d8" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||
"conform.nvim": { "branch": "master", "commit": "59d0dd233a2cafacfa1235ab22054c4d80a72319" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "1ba38e4cbb24683973e00c2e36f53ae64da38ef5" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "3e9a3f5a0cfcef1741e352c37bda4e82e5eb846a" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "805610a9393fa231f2c2b49cb521bfa413fadb3d" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "758bb5de98b805acc5eeed8cdc8ac7f0bc4b0b86" },
|
||||
"lspkind.nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "9ae570e206360e47d30b4c35a4550c165f4ea7b7" },
|
||||
"mason-nvim-dap.nvim": { "branch": "main", "commit": "67210c0e775adec55de9826b038e8b62de554afc" },
|
||||
"mason-tool-installer.nvim": { "branch": "main", "commit": "c1fbdcb0d8d1295314f1612c4a247253e70299d9" },
|
||||
"mason.nvim": { "branch": "main", "commit": "1b3d60405d1d720b2c4927f19672e9479703b00f" },
|
||||
"mini.nvim": { "branch": "main", "commit": "c333187fcc76d7e772dac32c2a440a949fe34be4" },
|
||||
"neodev.nvim": { "branch": "main", "commit": "ce9a2e8eaba5649b553529c5498acb43a6c317cd" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "24122371810089d390847d8ba66325c1f1aa64c0" },
|
||||
"nvim-dap": { "branch": "master", "commit": "615a1b2046e1eaf7995e0ba8e8a65f344201349d" },
|
||||
"nvim-dap-go": { "branch": "main", "commit": "5faf165f5062187320eaf9d177c3c1f647adc22e" },
|
||||
"nvim-dap-ui": { "branch": "master", "commit": "5934302d63d1ede12c0b22b6f23518bb183fc972" },
|
||||
"nvim-dap-virtual-text": { "branch": "master", "commit": "3e8e207513e6ef520894950acd76b79902714103" },
|
||||
"nvim-lint": { "branch": "master", "commit": "f3bcc28ffccb768212247294acccc106e029fc3c" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "94513a5b246cf32a8f87ca714af50911df63351c" },
|
||||
"nvim-nio": { "branch": "master", "commit": "8765cbc4d0c629c8158a5341e1b4305fd93c3a90" },
|
||||
"nvim-tmux-navigation": { "branch": "main", "commit": "4898c98702954439233fdaf764c39636681e2861" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "cd626dc48e42b2677d501a740622cf4aed43863f" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "dfa4178c0cadb44f687603d72ad0908474c28dd9" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "e37bb1feee9e7320c76050a55443fa843b4b6f83" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "08e301982b9a057110ede7a735dd1b5285eb341f" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "9ef21b2e6bb6ebeaf349a0781745549bbb870d27" },
|
||||
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
||||
"telescope.nvim": { "branch": "0.1.x", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "a7e39ae9e74f2c8c6dc4eea6d40c3971ae84752d" },
|
||||
"vim-dadbod": { "branch": "master", "commit": "37523ffe0849b51db07fa7f48430c2aca5420a0e" },
|
||||
"vim-dadbod-completion": { "branch": "master", "commit": "c920cb0ba3dff4b1b0ed373e1c0b3007dec696c2" },
|
||||
"vim-dadbod-ui": { "branch": "master", "commit": "b1675d1f56c12b0abac2ef74b94670fe27adcf93" }
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
local luasnip = require "luasnip"
|
||||
luasnip.config.setup {
|
||||
history = false,
|
||||
updateevents = "TextChanged,TextChangedI",
|
||||
}
|
||||
|
||||
local lspkind = require "lspkind"
|
||||
lspkind.init {}
|
||||
|
||||
local cmp = require "cmp"
|
||||
cmp.setup {
|
||||
sources = {
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "path" },
|
||||
{ name = "buffer" },
|
||||
},
|
||||
completion = { completeopt = "menu, menuone, noinsert, noselect" },
|
||||
|
||||
-- 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" },
|
||||
},
|
||||
})
|
||||
@@ -1,52 +0,0 @@
|
||||
--[[
|
||||
--
|
||||
-- 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,
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
return {
|
||||
"catppuccin/nvim",
|
||||
name = "catpuccin",
|
||||
priority = 1000,
|
||||
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" })
|
||||
end,
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
return {
|
||||
"numToStr/Comment.nvim",
|
||||
opts = {},
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
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,
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
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" },
|
||||
go = { "gofumpt", "goimports_reviser" },
|
||||
lua = { "stylua" },
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
return {
|
||||
"tpope/vim-dadbod",
|
||||
"kristijanhusak/vim-dadbod-completion",
|
||||
"kristijanhusak/vim-dadbod-ui",
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
-- 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",
|
||||
"williamboman/mason.nvim",
|
||||
"jay-babu/mason-nvim-dap.nvim",
|
||||
|
||||
-- GO DEBUG
|
||||
"leoluz/nvim-dap-go",
|
||||
},
|
||||
config = function()
|
||||
local dap = require "dap"
|
||||
local dapui = require "dapui"
|
||||
|
||||
require("mason-nvim-dap").setup {
|
||||
-- Makes a best effort to setup the various debuggers with
|
||||
-- reasonable debug configurations
|
||||
automatic_setup = true,
|
||||
|
||||
automatic_installation = true,
|
||||
|
||||
-- You can provide additional configuration to the handlers,
|
||||
-- see mason-nvim-dap README for more information
|
||||
handlers = {},
|
||||
|
||||
-- You'll need to check that you have the required things installed
|
||||
-- online, please don't ask me how to install them :)
|
||||
ensure_installed = {
|
||||
-- Update this to ensure that you have the debuggers for the langs you want
|
||||
"delve",
|
||||
},
|
||||
}
|
||||
|
||||
-- Basic debugging keymaps, feel free to change to your liking!
|
||||
vim.keymap.set("n", "<F5>", dap.continue, { desc = "Debug: Start/Continue" })
|
||||
vim.keymap.set("n", "<F1>", dap.step_into, { desc = "Debug: Step Into" })
|
||||
vim.keymap.set("n", "<F2>", dap.step_over, { desc = "Debug: Step Over" })
|
||||
vim.keymap.set("n", "<F3>", dap.step_out, { desc = "Debug: Step Out" })
|
||||
vim.keymap.set("n", "<leader>b", dap.toggle_breakpoint, { desc = "Debug: Toggle Breakpoint" })
|
||||
vim.keymap.set("n", "<leader>B", function()
|
||||
dap.set_breakpoint(vim.fn.input "Breakpoint condition: ")
|
||||
end, { desc = "Debug: Set Breakpoint" })
|
||||
|
||||
-- Dap UI setup
|
||||
-- For more information, see |:help nvim-dap-ui|
|
||||
dapui.setup {
|
||||
icons = { expanded = "▾", collapsed = "▸", current_frame = "*" },
|
||||
controls = {
|
||||
icons = {
|
||||
pause = "⏸",
|
||||
play = "▶",
|
||||
step_into = "⏎",
|
||||
step_over = "⏭",
|
||||
step_out = "⏮",
|
||||
step_back = "b",
|
||||
run_last = "▶▶",
|
||||
terminate = "⏹",
|
||||
disconnect = "⏏",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
|
||||
vim.keymap.set("n", "<F7>", dapui.toggle, { desc = "Debug: See last session result." })
|
||||
|
||||
dap.listeners.after.event_initialized["dapui_config"] = dapui.open
|
||||
dap.listeners.before.event_terminated["dapui_config"] = dapui.close
|
||||
dap.listeners.before.event_exited["dapui_config"] = dapui.close
|
||||
|
||||
require("dap-go").setup()
|
||||
end,
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
return {
|
||||
"lewis6991/gitsigns.nvim",
|
||||
opts = {
|
||||
signs = {
|
||||
add = { text = "+" },
|
||||
change = { text = "~" },
|
||||
delete = { text = "_" },
|
||||
topdelete = { text = "‾" },
|
||||
changedelete = { text = "~" },
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
main = "ibl",
|
||||
opts = {
|
||||
indent = { char = "┊" },
|
||||
whitespace = { highlight = { "Whitespace", "NonText" } },
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = function()
|
||||
local lint = require "lint"
|
||||
|
||||
lint.linters_by_ft = {
|
||||
python = { "ruff", "mypy" },
|
||||
}
|
||||
|
||||
-- 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,
|
||||
},
|
||||
}
|
||||
@@ -1,143 +0,0 @@
|
||||
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" },
|
||||
},
|
||||
jsonls = {
|
||||
settings = {
|
||||
json = {
|
||||
schemas = require("schemastore").json.schemas(),
|
||||
validate = { enable = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
pyright = {},
|
||||
tsserver = {},
|
||||
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' } },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
require("mason").setup()
|
||||
|
||||
local ensure_installed = vim.tbl_keys(servers or {})
|
||||
vim.list_extend(ensure_installed, {
|
||||
"clang-format",
|
||||
"gofumpt",
|
||||
"goimports-reviser",
|
||||
"mypy",
|
||||
"prettier",
|
||||
"ruff",
|
||||
"stylua",
|
||||
})
|
||||
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,
|
||||
},
|
||||
}
|
||||
|
||||
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,
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
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,
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
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,
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
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,
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
return {
|
||||
"folke/todo-comments.nvim",
|
||||
event = "VimEnter",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
opts = { signs = false },
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
},
|
||||
opts = {
|
||||
ensure_installed = { "c", "go", "html", "javascript", "lua", "python" },
|
||||
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,
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
-- 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" })
|
||||
@@ -1,54 +0,0 @@
|
||||
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>e", vim.diagnostic.open_float, { desc = "Show diagnostic [E]rror messages" })
|
||||
set("n", "<leader>q", vim.diagnostic.setloclist, { desc = "Open diagnostic [Q]uickfix list" })
|
||||
|
||||
-- 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("kickstart-highlight-yank", { clear = true }),
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
})
|
||||
@@ -1,47 +0,0 @@
|
||||
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 = "↳ "
|
||||
@@ -1,23 +0,0 @@
|
||||
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)
|
||||
@@ -1,3 +0,0 @@
|
||||
indent_type = "Spaces"
|
||||
indent_width = 4
|
||||
no_call_parentheses = true
|
||||
Reference in New Issue
Block a user