mirror of
https://github.com/pratiktri/dotfiles.git
synced 2026-02-04 08:41:43 +05:30
- .gitignore updated to add more JS specific things and log files
- Ideavim config: organized, added more VIM options, more keymaps - .profile updated to map the caps-lock key to escape on system login - .zshrc updated to enable VIM mode on zsh shell - Removed LazyVim config - would reconfigure it from scratch
This commit is contained in:
@@ -2,11 +2,11 @@
|
||||
// Global
|
||||
"update.mode": "manual",
|
||||
"workbench.settings.editor": "json",
|
||||
//
|
||||
|
||||
// Privacy
|
||||
"telemetry.telemetryLevel": "off",
|
||||
"extensions.ignoreRecommendations": true,
|
||||
//
|
||||
|
||||
// Editor
|
||||
"editor.fontSize": 21, // Increase the Editor's font to offset
|
||||
"window.zoomLevel": -1, // Reduces the Activity Bar size
|
||||
@@ -28,13 +28,13 @@
|
||||
"files.autoSaveDelay": 1000,
|
||||
"diffEditor.renderSideBySide": true,
|
||||
"diffEditor.ignoreTrimWhitespace": false,
|
||||
//
|
||||
|
||||
// Editor Font
|
||||
"editor.fontFamily": "FuraCode Nerd Font",
|
||||
"editor.fontLigatures": true,
|
||||
"terminal.integrated.fontFamily": "FuraCode Nerd Font",
|
||||
"terminal.integrated.fontSize": 20,
|
||||
//
|
||||
|
||||
// Workbench - Everything that surrounds the editor
|
||||
"workbench.startupEditor": "newUntitledFile",
|
||||
"workbench.sideBar.location": "left",
|
||||
@@ -45,14 +45,10 @@
|
||||
"bookmarks.navigateThroughAllFiles": true,
|
||||
"window.menuBarVisibility": "compact",
|
||||
"explorer.confirmDragAndDrop": false,
|
||||
//
|
||||
// Screencast Options
|
||||
"screencastMode.verticalOffset": 5,
|
||||
"screencastMode.fontSize": 45,
|
||||
//
|
||||
|
||||
// Debugging
|
||||
"debug.toolBarLocation": "docked",
|
||||
//
|
||||
|
||||
// Prettier Plugin
|
||||
"prettier.tabWidth": 4,
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
@@ -64,7 +60,7 @@
|
||||
"[json]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
//
|
||||
|
||||
// Code Spell Checker Plugin
|
||||
"cSpell.diagnosticLevel": "Hint",
|
||||
"cSpell.allowCompoundWords": true,
|
||||
@@ -115,12 +111,12 @@
|
||||
"umount",
|
||||
"unmount"
|
||||
],
|
||||
//
|
||||
|
||||
// Shell check plugin
|
||||
"shellcheck.run": "onSave",
|
||||
"shellcheck.exclude": ["2181", "2039"],
|
||||
"security.workspace.trust.untrustedFiles": "open",
|
||||
//
|
||||
|
||||
// Better Comments
|
||||
"better-comments.tags": [
|
||||
{
|
||||
@@ -169,30 +165,15 @@
|
||||
"italic": false
|
||||
}
|
||||
],
|
||||
// ES Lint
|
||||
"eslint.alwaysShowStatus": true,
|
||||
"eslint.run": "onSave",
|
||||
//
|
||||
|
||||
// JavaScript
|
||||
"typescript.suggest.paths": false,
|
||||
//
|
||||
|
||||
// Git
|
||||
"git.enableSmartCommit": true,
|
||||
"git.autofetch": true,
|
||||
"git.confirmSync": false,
|
||||
// GetLens
|
||||
"gitlens.hovers.currentLine.over": "line",
|
||||
"gitlens.advanced.telemetry.enabled": false,
|
||||
"gitlens.statusBar.reduceFlicker": true,
|
||||
"gitlens.blame.avatars": false,
|
||||
"gitlens.currentLine.uncommittedChangesFormat": "✏️ ${ago}",
|
||||
"gitlens.codeLens.enabled": false,
|
||||
"gitlens.currentLine.enabled": false,
|
||||
"gitlens.views.branches.branches.layout": "list",
|
||||
//
|
||||
// Golang
|
||||
"go.useLanguageServer": true,
|
||||
"go.formatTool": "gofmt",
|
||||
|
||||
// Markdown
|
||||
"markdownlint.run": "onType",
|
||||
"markdown.extension.print.imgToBase64": true,
|
||||
@@ -213,53 +194,22 @@
|
||||
"no-hard-tabs": false,
|
||||
"line-length": false
|
||||
},
|
||||
// LaTex
|
||||
// https://nevalsar.hashnode.dev/compiling-latex-with-ubuntu-and-visual-studio-code#heading-issues-with-modules-setting-additional-compiler-flags
|
||||
"latex-workshop.latex.tools": [
|
||||
{
|
||||
"name": "latexmk",
|
||||
"command": "latexmk",
|
||||
"args": [
|
||||
"--shell-escape",
|
||||
"-synctex=1",
|
||||
"-interaction=nonstopmode",
|
||||
"-file-line-error",
|
||||
"-pdf",
|
||||
"-outdir=%OUTDIR%",
|
||||
"%DOC%"
|
||||
],
|
||||
"env": {}
|
||||
},
|
||||
{
|
||||
"name": "pdflatex",
|
||||
"command": "pdflatex",
|
||||
"args": [
|
||||
"--shell-escape",
|
||||
"-synctex=1",
|
||||
"-interaction=nonstopmode",
|
||||
"-file-line-error",
|
||||
"%DOC%"
|
||||
],
|
||||
"env": {}
|
||||
},
|
||||
{
|
||||
"name": "bibtex",
|
||||
"command": "bibtex",
|
||||
"args": ["--shell-escape", "%DOCFILE%"],
|
||||
"env": {}
|
||||
}
|
||||
],
|
||||
|
||||
//
|
||||
// Vim Plugin
|
||||
"vim.foldfix": true,
|
||||
"vim.highlightedyank.enable": true,
|
||||
"vim.hlsearch": true,
|
||||
"vim.leader": " ",
|
||||
"vim.showMarksInGutter": true,
|
||||
"vim.smartRelativeLine": true,
|
||||
"vim.vimrc.enable": true,
|
||||
"vim.useSystemClipboard": true,
|
||||
|
||||
// Python
|
||||
"python.jediEnabled": false,
|
||||
"python.languageServer": "Pylance",
|
||||
"workbench.iconTheme": "material-icon-theme",
|
||||
"workbench.colorTheme": "GitHub Dark",
|
||||
// "theme-by-language.themes": {
|
||||
// "*": "GitHub Dark",
|
||||
// "markdown": "Community Material Theme Darker High Contrast"
|
||||
// },
|
||||
|
||||
// Rust
|
||||
// "rust.build_on_save": true,
|
||||
@@ -276,6 +226,7 @@
|
||||
//
|
||||
"terminal.integrated.shell.linux": "/bin/zsh",
|
||||
"debug.javascript.autoAttachFilter": "disabled",
|
||||
"debug.onTaskErrors": "debugAnyway"
|
||||
"debug.onTaskErrors": "debugAnyway",
|
||||
"vim.disableExtension": true
|
||||
//
|
||||
}
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
{
|
||||
"neodev": {
|
||||
"library": {
|
||||
"enabled": true,
|
||||
"plugins": true
|
||||
}
|
||||
},
|
||||
"neoconf": {
|
||||
"plugins": {
|
||||
"lua_ls": {
|
||||
"enabled": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
require("pratik.core")
|
||||
require("pratik.lazy")
|
||||
@@ -1,40 +0,0 @@
|
||||
{
|
||||
"LuaSnip": { "branch": "master", "commit": "80a8528f084a97b624ae443a6f50ff8074ba486b" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "1f2d1206a03bd3add8aedf6251e4534611de577f" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "43727c2ff84240e55d4069ec3e6158d74cb534b6" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "af0f583cd35286dd6f0e3ed52622728703237e50" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "16603c6917435d8446f7357cb61095138a417085" },
|
||||
"lspkind.nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "2248ef254d0a1488a72041cfb45ca9caada6d994" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "40301e1c74bc0946eece13edf2b1c561cc497491" },
|
||||
"mason-tool-installer.nvim": { "branch": "main", "commit": "e4f34741daa9cf95de68a603d3e7a6844a69fdf0" },
|
||||
"mason.nvim": { "branch": "main", "commit": "cd7835b15f5a4204fc37e0aa739347472121a54c" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "0f04d78619cce9a5af4f355968040f7d675854a1" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "51260c02a8ffded8e16162dcf41a23ec90cfba62" },
|
||||
"nvim-colorizer.lua": { "branch": "master", "commit": "dde3084106a70b9a79d48f426f6d6fec6fd203f7" },
|
||||
"nvim-lsp-file-operations": { "branch": "master", "commit": "0ae13ac58136c6175638b6e1ba04cb487dd22272" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "cb49a4cd622d7ed775c31561bb8aa6a50712d6b9" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "78a9ca5ed6557f29cd0ce203df44213e54bfabb9" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "bf0a96568a54618138ac42c84758945cdafef86b" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "e69a504baf2951d52e1f1fbb05145d43f236cbf1" },
|
||||
"nvim-ts-autotag": { "branch": "main", "commit": "6be1192965df35f94b8ea6d323354f7dc7a557e4" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "5de460ca7595806044eced31e3c36c159a493857" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" },
|
||||
"symbols-outline.nvim": { "branch": "master", "commit": "512791925d57a61c545bc303356e8a8f7869763c" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" },
|
||||
"telescope.nvim": { "branch": "0.1.x", "commit": "7011eaae0ac1afe036e30c95cf80200b8dc3f21a" },
|
||||
"vim-commentary": { "branch": "master", "commit": "e87cd90dc09c2a203e13af9704bd0ef79303d755" },
|
||||
"vim-fugitive": { "branch": "master", "commit": "cbe9dfa162c178946afa689dd3f42d4ea8bf89c1" },
|
||||
"vim-gitgutter": { "branch": "main", "commit": "f7b97666ae36c7b3f262f3190dbcd7033845d985" },
|
||||
"vim-highlightedyank": { "branch": "master", "commit": "fa3f57b097e9521ce41a66b6c7cf5d9adea70ea3" },
|
||||
"vim-maximizer": { "branch": "master", "commit": "2e54952fe91e140a2e69f35f22131219fcd9c5f1" },
|
||||
"vim-nightfly-guicolors": { "branch": "master", "commit": "9053e99131731f268258ab4d35d4841c3126ff9a" },
|
||||
"vim-paragraph-motion": { "branch": "master", "commit": "2f6b36670327952b0bcc6915f4947feb85977af3" },
|
||||
"vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" },
|
||||
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" },
|
||||
"vim-trailing-whitespace": { "branch": "master", "commit": "5540b3faa2288b226a8d9a4e8244558b12c598aa" }
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
require("pratik.core.keymaps")
|
||||
require("pratik.core.options")
|
||||
@@ -1,48 +0,0 @@
|
||||
-- set leader key to space
|
||||
vim.g.mapleader = " "
|
||||
|
||||
local keymap = vim.keymap
|
||||
|
||||
-- General Keymaps -------------------
|
||||
|
||||
-- clear search highlights
|
||||
keymap.set("n", "<leader>hx", ":nohl<CR>", { desc = "Clear search highlights" })
|
||||
|
||||
-- delete single character without copying into register
|
||||
keymap.set("n", "x", '"_x')
|
||||
|
||||
-- increment/decrement numbers
|
||||
keymap.set("n", "<leader>+", "<C-a>", { desc = "Increment number" })
|
||||
keymap.set("n", "<leader>-", "<C-x>", { desc = "Decrement number" })
|
||||
|
||||
-- window management
|
||||
keymap.set("n", "<leader>sv", "<C-w>v", { desc = "Split window vertically" })
|
||||
keymap.set("n", "<leader>sh", "<C-w>s", { desc = "Split window horizontally" })
|
||||
keymap.set("n", "<leader>se", "<C-w>=", { desc = "Make splits equal size" })
|
||||
keymap.set("n", "<leader>sx", "<cmd>close<CR>", { desc = "Close current split" })
|
||||
|
||||
keymap.set("n", "<leader>ta", "<cmd>tabnew<CR>", { desc = "Open new tab" })
|
||||
keymap.set("n", "<leader>tx", "<cmd>tabclose<CR>", { desc = "Close current tab" })
|
||||
keymap.set("n", "<leader>tn", "<cmd>tabn<CR>", { desc = "Go to next tab" })
|
||||
keymap.set("n", "<leader>tp", "<cmd>tabp<CR>", { desc = "Go to previous tab" })
|
||||
-- keymap.set("n", "<leader>tf", "<cmd>tabnew %<CR>", { desc = "Open current buffer in new tab" })
|
||||
|
||||
-- Center cursor after scrolling
|
||||
keymap.set("n", "<C-d>", "<C-d>zz")
|
||||
keymap.set("n", "<C-u>", "<C-u>zz")
|
||||
|
||||
-- Plugin Keymaps -------------------
|
||||
|
||||
-- vim-maximizer
|
||||
keymap.set("n", "<leader>sm", ":MaximizerToggle<CR>", { desc = "Maximize Split" })
|
||||
|
||||
-- nvim-tree
|
||||
keymap.set("n", "<leader>ee", ":NvimTreeToggle<CR>", { desc = "Open/Close file explorer" })
|
||||
keymap.set("n", "<leader>ef", ":NvimTreeFocus<CR>", { desc = "Bring focus back to file explorer" })
|
||||
keymap.set("n", "<leader>er", "<cmd>NvimTreeRefresh<CR>", { desc = "Refresh file explorer" })
|
||||
|
||||
-- telescope
|
||||
keymap.set("n", "<leader>ff", "<cmd>Telescope find_files<cr>", { desc = "Fuzzy find files in cwd" })
|
||||
keymap.set("n", "<leader>fr", "<cmd>Telescope oldfiles<cr>", { desc = "Fuzzy find recent files" })
|
||||
keymap.set("n", "<leader>fs", "<cmd>Telescope live_grep<cr>", { desc = "Find string in cwd" })
|
||||
keymap.set("n", "<leader>fc", "<cmd>Telescope grep_string<cr>", { desc = "Find string under cursor in cwd" })
|
||||
@@ -1,51 +0,0 @@
|
||||
local opt = vim.opt -- for conciseness
|
||||
|
||||
-- line numbers
|
||||
opt.relativenumber = true -- show relative line numbers
|
||||
opt.number = true -- shows absolute line number on cursor line (when relative number is on)
|
||||
|
||||
-- tabs & indentation
|
||||
opt.tabstop = 2 -- 2 spaces for tabs (prettier default)
|
||||
opt.shiftwidth = 2 -- 2 spaces for indent width
|
||||
opt.expandtab = true -- expand tab to spaces
|
||||
opt.autoindent = true -- copy indent from current line when starting new one
|
||||
|
||||
-- line wrapping
|
||||
opt.wrap = true -- disable line wrapping
|
||||
|
||||
opt.encoding = "utf-8"
|
||||
|
||||
opt.syntax = "on"
|
||||
opt.showmatch = true
|
||||
opt.shortmess:append("I")
|
||||
opt.mouse:append("a")
|
||||
|
||||
-- search settings
|
||||
opt.ignorecase = true -- ignore case when searching
|
||||
opt.smartcase = true -- if you include mixed case in your search, assumes you want case-sensitive
|
||||
opt.incsearch = true
|
||||
|
||||
-- cursor line
|
||||
opt.cursorline = true -- highlight the current cursor line
|
||||
|
||||
-- appearance
|
||||
|
||||
-- turn on termguicolors for nightfly colorscheme to work
|
||||
-- (have to use iterm2 or any other true color terminal)
|
||||
opt.termguicolors = true
|
||||
opt.background = "dark" -- colorschemes that can be light or dark will be made dark
|
||||
opt.signcolumn = "yes" -- show sign column so that text doesn't shift
|
||||
|
||||
-- backspace
|
||||
opt.backspace = "indent,eol,start" -- allow backspace on indent, end of line or insert mode start position
|
||||
|
||||
-- clipboard
|
||||
opt.clipboard:append("unnamedplus") -- use system clipboard as default register
|
||||
opt.clipboard:append("unnamed")
|
||||
|
||||
-- split windows
|
||||
opt.splitright = true -- split vertical window to the right
|
||||
opt.splitbelow = true -- split horizontal window to the bottom
|
||||
|
||||
-- turn off swapfile
|
||||
opt.swapfile = false
|
||||
@@ -1,15 +0,0 @@
|
||||
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(vim.env.LAZY or lazypath)
|
||||
|
||||
require("lazy").setup({
|
||||
{ import = "pratik.plugins" },
|
||||
{ import = "pratik.plugins.ide" },
|
||||
{ import = "pratik.plugins.looks" },
|
||||
}, {
|
||||
change_detection = {
|
||||
notify = false,
|
||||
}
|
||||
})
|
||||
@@ -1,4 +0,0 @@
|
||||
return {
|
||||
"stevearc/dressing.nvim",
|
||||
event = "VeryLazy",
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
return {
|
||||
"windwp/nvim-autopairs",
|
||||
event = { "InsertEnter" },
|
||||
dependencies = {
|
||||
"hrsh7th/nvim-cmp",
|
||||
},
|
||||
config = function()
|
||||
-- configure autopairs
|
||||
require("nvim-autopairs").setup({
|
||||
check_ts = true, -- enable treesitter
|
||||
ts_config = {
|
||||
lua = { "string" }, -- don't add pairs in lua string treesitter nodes
|
||||
javascript = { "template_string" }, -- don't add pairs in javscript template_string treesitter nodes
|
||||
java = false, -- don't check treesitter on java
|
||||
},
|
||||
})
|
||||
|
||||
-- import nvim-autopairs completion functionality
|
||||
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
|
||||
|
||||
-- make autopairs and completion work together
|
||||
require("cmp").event:on("confirm_done", cmp_autopairs.on_confirm_done())
|
||||
end,
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
return {
|
||||
"lewis6991/gitsigns.nvim",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = true,
|
||||
}
|
||||
@@ -1,134 +0,0 @@
|
||||
return {
|
||||
"neovim/nvim-lspconfig",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
{ "antosha417/nvim-lsp-file-operations", config = true },
|
||||
},
|
||||
config = function()
|
||||
-- Change the Diagnostic symbols in the sign column (gutter)
|
||||
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
|
||||
|
||||
-- import lspconfig plugin
|
||||
local lspconfig = require("lspconfig")
|
||||
|
||||
-- used to enable autocompletion (assign to every lsp server config)
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
|
||||
-- configure html server
|
||||
lspconfig["html"].setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
-- configure typescript server with plugin
|
||||
lspconfig["tsserver"].setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
-- configure css server
|
||||
lspconfig["cssls"].setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
-- configure tailwindcss server
|
||||
lspconfig["tailwindcss"].setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
-- configure graphql language server
|
||||
lspconfig["graphql"].setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
filetypes = { "graphql", "gql", "svelte", "typescriptreact", "javascriptreact" },
|
||||
})
|
||||
|
||||
-- configure emmet language server
|
||||
lspconfig["emmet_ls"].setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
filetypes = { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less", "svelte" },
|
||||
})
|
||||
|
||||
-- configure python server
|
||||
lspconfig["pyright"].setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
-- configure lua server (with special settings)
|
||||
lspconfig["lua_ls"].setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = { -- custom settings for lua
|
||||
Lua = {
|
||||
-- make the language server recognize "vim" global
|
||||
diagnostics = {
|
||||
globals = { "vim" },
|
||||
},
|
||||
workspace = {
|
||||
-- make language server aware of runtime files
|
||||
library = {
|
||||
[vim.fn.expand("$VIMRUNTIME/lua")] = true,
|
||||
[vim.fn.stdpath("config") .. "/lua"] = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Setup keymaps
|
||||
local keymap = vim.keymap -- for conciseness
|
||||
local opts = { noremap = true, silent = true }
|
||||
local on_attach = function(client, bufnr)
|
||||
opts.buffer = bufnr
|
||||
|
||||
opts.desc = "Show LSP references"
|
||||
keymap.set("n", "gR", "<cmd>Telescope lsp_references<CR>", opts) -- show definition, references
|
||||
|
||||
opts.desc = "Go to declaration"
|
||||
keymap.set("n", "gD", vim.lsp.buf.declaration, opts) -- go to declaration
|
||||
|
||||
opts.desc = "Show LSP definitions"
|
||||
keymap.set("n", "gd", "<cmd>Telescope lsp_definitions<CR>", opts) -- show lsp definitions
|
||||
|
||||
opts.desc = "Show LSP implementations"
|
||||
keymap.set("n", "gi", "<cmd>Telescope lsp_implementations<CR>", opts) -- show lsp implementations
|
||||
|
||||
opts.desc = "Show LSP type definitions"
|
||||
keymap.set("n", "gt", "<cmd>Telescope lsp_type_definitions<CR>", opts) -- show lsp type definitions
|
||||
|
||||
opts.desc = "See available code actions"
|
||||
keymap.set({ "n", "v" }, "<leader>ca", vim.lsp.buf.code_action, opts) -- see available code actions, in visual mode will apply to selection
|
||||
|
||||
opts.desc = "Smart rename"
|
||||
keymap.set("n", "<leader>rn", vim.lsp.buf.rename, opts) -- smart rename
|
||||
|
||||
opts.desc = "Show buffer diagnostics"
|
||||
keymap.set("n", "<leader>D", "<cmd>Telescope diagnostics bufnr=0<CR>", opts) -- show diagnostics for file
|
||||
|
||||
opts.desc = "Show line diagnostics"
|
||||
keymap.set("n", "<leader>d", vim.diagnostic.open_float, opts) -- show diagnostics for line
|
||||
|
||||
opts.desc = "Go to previous diagnostic"
|
||||
keymap.set("n", "[d", vim.diagnostic.goto_prev, opts) -- jump to previous diagnostic in buffer
|
||||
|
||||
opts.desc = "Go to next diagnostic"
|
||||
keymap.set("n", "]d", vim.diagnostic.goto_next, opts) -- jump to next diagnostic in buffer
|
||||
|
||||
opts.desc = "Show documentation for what is under cursor"
|
||||
keymap.set("n", "K", vim.lsp.buf.hover, opts) -- show documentation for what is under cursor
|
||||
|
||||
opts.desc = "Restart LSP"
|
||||
keymap.set("n", "<leader>rs", ":LspRestart<CR>", opts) -- mapping to restart lsp if necessary
|
||||
end
|
||||
|
||||
end,
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
return {
|
||||
"williamboman/mason.nvim",
|
||||
dependencies = {
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
"WhoIsSethDaniel/mason-tool-installer.nvim",
|
||||
},
|
||||
config = function()
|
||||
-- enable mason and configure icons
|
||||
require("mason").setup({
|
||||
ui = {
|
||||
icons = {
|
||||
package_installed = "✓",
|
||||
package_pending = "➜",
|
||||
package_uninstalled = "✗",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
require("mason-lspconfig").setup({
|
||||
-- list of servers for mason to install
|
||||
ensure_installed = {
|
||||
"tsserver",
|
||||
"html",
|
||||
"cssls",
|
||||
"lua_ls",
|
||||
"graphql",
|
||||
"emmet_ls",
|
||||
"pyright",
|
||||
"rust_analyzer",
|
||||
"dockerls",
|
||||
"bashls",
|
||||
"yamlls",
|
||||
"jsonls"
|
||||
},
|
||||
-- auto-install configured servers (with lspconfig)
|
||||
automatic_installation = true, -- not the same as ensure_installed
|
||||
})
|
||||
|
||||
require("mason-tool-installer").setup({
|
||||
ensure_installed = {
|
||||
"prettier", -- prettier formatter
|
||||
"stylua", -- lua formatter
|
||||
"isort", -- python formatter
|
||||
"black", -- python formatter
|
||||
"pylint", -- python linter
|
||||
"eslint_d", -- js linter
|
||||
"jsonlint",
|
||||
"markdownlint",
|
||||
"shellcheck",
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
return {
|
||||
"hrsh7th/nvim-cmp",
|
||||
event = "InsertEnter",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-buffer", -- source for text in buffer
|
||||
"hrsh7th/cmp-path", -- source for file system paths
|
||||
"L3MON4D3/LuaSnip", -- snippet engine
|
||||
"saadparwaiz1/cmp_luasnip", -- for autocompletion
|
||||
"rafamadriz/friendly-snippets", -- useful snippets
|
||||
"onsails/lspkind.nvim", -- vs-code like pictograms
|
||||
-- Rust Cargo
|
||||
dependencies = {
|
||||
{
|
||||
"Saecki/crates.nvim",
|
||||
event = { "BufRead Cargo.toml" },
|
||||
opts = {
|
||||
src = {
|
||||
cmp = { enabled = true },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
local cmp = require("cmp")
|
||||
local luasnip = require("luasnip")
|
||||
local lspkind = require("lspkind")
|
||||
|
||||
-- loads vscode style snippets from installed plugins (e.g. friendly-snippets)
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
|
||||
cmp.setup({
|
||||
completion = {
|
||||
completeopt = "menu,menuone,preview,noselect",
|
||||
},
|
||||
snippet = { -- configure how nvim-cmp interacts with snippet engine
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-k>"] = cmp.mapping.select_prev_item(), -- previous suggestion
|
||||
["<C-j>"] = cmp.mapping.select_next_item(), -- next suggestion
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(), -- show completion suggestions
|
||||
["<C-e>"] = cmp.mapping.abort(), -- close completion window
|
||||
["<CR>"] = cmp.mapping.confirm({ select = false }),
|
||||
}),
|
||||
-- sources for autocompletion
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "crates" }, -- Rust crates
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "buffer" }, -- text within current buffer
|
||||
{ name = "path" }, -- file system paths
|
||||
}),
|
||||
-- configure lspkind for vs-code like pictograms in completion menu
|
||||
formatting = {
|
||||
format = lspkind.cmp_format({
|
||||
maxwidth = 50,
|
||||
ellipsis_char = "...",
|
||||
}),
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
return {
|
||||
"neovim/nvim-lspconfig",
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"simrat39/symbols-outline.nvim",
|
||||
cmd = "SymbolsOutline",
|
||||
keys = { { "<leader>cs", "<cmd>SymbolsOutline<cr>", desc = "Symbols Outline" } },
|
||||
config = true,
|
||||
},
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
return{
|
||||
-- My Favorite vanilla Vim plugins
|
||||
'tpope/vim-fugitive',
|
||||
'tpope/vim-surround',
|
||||
'tpope/vim-repeat',
|
||||
'machakann/vim-highlightedyank',
|
||||
'dbakker/vim-paragraph-motion',
|
||||
'airblade/vim-gitgutter',
|
||||
'bronson/vim-trailing-whitespace',
|
||||
'tpope/vim-commentary',
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
return {
|
||||
"NvChad/nvim-colorizer.lua",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = true,
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
config = function()
|
||||
local lualine = require("lualine")
|
||||
local lazy_status = require("lazy.status") -- to configure lazy pending updates count
|
||||
|
||||
local colors = {
|
||||
blue = "#65D1FF",
|
||||
green = "#3EFFDC",
|
||||
violet = "#FF61EF",
|
||||
yellow = "#FFDA7B",
|
||||
red = "#FF4A4A",
|
||||
fg = "#c3ccdc",
|
||||
bg = "#112638",
|
||||
inactive_bg = "#2c3043",
|
||||
}
|
||||
|
||||
local my_lualine_theme = {
|
||||
normal = {
|
||||
a = { bg = colors.blue, fg = colors.bg, gui = "bold" },
|
||||
b = { bg = colors.bg, fg = colors.fg },
|
||||
c = { bg = colors.bg, fg = colors.fg },
|
||||
},
|
||||
insert = {
|
||||
a = { bg = colors.green, fg = colors.bg, gui = "bold" },
|
||||
b = { bg = colors.bg, fg = colors.fg },
|
||||
c = { bg = colors.bg, fg = colors.fg },
|
||||
},
|
||||
visual = {
|
||||
a = { bg = colors.violet, fg = colors.bg, gui = "bold" },
|
||||
b = { bg = colors.bg, fg = colors.fg },
|
||||
c = { bg = colors.bg, fg = colors.fg },
|
||||
},
|
||||
command = {
|
||||
a = { bg = colors.yellow, fg = colors.bg, gui = "bold" },
|
||||
b = { bg = colors.bg, fg = colors.fg },
|
||||
c = { bg = colors.bg, fg = colors.fg },
|
||||
},
|
||||
replace = {
|
||||
a = { bg = colors.red, fg = colors.bg, gui = "bold" },
|
||||
b = { bg = colors.bg, fg = colors.fg },
|
||||
c = { bg = colors.bg, fg = colors.fg },
|
||||
},
|
||||
inactive = {
|
||||
a = { bg = colors.inactive_bg, fg = colors.semilightgray, gui = "bold" },
|
||||
b = { bg = colors.inactive_bg, fg = colors.semilightgray },
|
||||
c = { bg = colors.inactive_bg, fg = colors.semilightgray },
|
||||
},
|
||||
}
|
||||
|
||||
-- configure lualine with modified theme
|
||||
lualine.setup({
|
||||
options = {
|
||||
theme = my_lualine_theme,
|
||||
},
|
||||
sections = {
|
||||
lualine_x = {
|
||||
{
|
||||
lazy_status.updates,
|
||||
cond = lazy_status.has_updates,
|
||||
color = { fg = "#ff9e64" },
|
||||
},
|
||||
{ "encoding" },
|
||||
{ "fileformat" },
|
||||
{ "filetype" },
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
return {
|
||||
'bluz71/vim-nightfly-guicolors',
|
||||
priority = 1000, -- Makes sure this loads before all other plugins
|
||||
config = function()
|
||||
-- load the colorscheme here
|
||||
vim.cmd([[colorscheme nightfly]])
|
||||
end,
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
return{
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
return{
|
||||
'szw/vim-maximizer',
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
return {
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
config = function()
|
||||
local nvimtree = require("nvim-tree")
|
||||
|
||||
-- recommended settings from nvim-tree documentation
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
-- change color for arrows in tree to light blue
|
||||
vim.cmd([[ highlight NvimTreeFolderArrowClosed guifg=#3FC5FF ]])
|
||||
vim.cmd([[ highlight NvimTreeFolderArrowOpen guifg=#3FC5FF ]])
|
||||
|
||||
-- configure nvim-tree
|
||||
nvimtree.setup({
|
||||
view = {
|
||||
width = 28,
|
||||
relativenumber = true,
|
||||
},
|
||||
-- change folder arrow icons
|
||||
renderer = {
|
||||
indent_markers = {
|
||||
enable = true,
|
||||
},
|
||||
icons = {
|
||||
glyphs = {
|
||||
folder = {
|
||||
arrow_closed = "", -- arrow when folder is closed
|
||||
arrow_open = "", -- arrow when folder is open
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
-- disable window_picker for
|
||||
-- explorer to work well with
|
||||
-- window splits
|
||||
actions = {
|
||||
open_file = {
|
||||
window_picker = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
filters = {
|
||||
custom = { ".DS_Store" },
|
||||
},
|
||||
git = {
|
||||
ignore = false,
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
branch = "0.1.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
config = function()
|
||||
local telescope = require("telescope")
|
||||
local actions = require("telescope.actions")
|
||||
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
path_display = { "truncate " },
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-k>"] = actions.move_selection_previous, -- move to prev result
|
||||
["<C-j>"] = actions.move_selection_next, -- move to next result
|
||||
["<C-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
telescope.load_extension("fzf")
|
||||
|
||||
-- set keymaps
|
||||
local keymap = vim.keymap -- for conciseness
|
||||
end,
|
||||
}
|
||||
@@ -1,110 +0,0 @@
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
lazy = true,
|
||||
config = function()
|
||||
require("nvim-treesitter.configs").setup({
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
|
||||
-- Automatically jump forward to textobj, similar to targets.vim
|
||||
lookahead = true,
|
||||
|
||||
keymaps = {
|
||||
-- You can use the capture groups defined in textobjects.scm
|
||||
["a="] = { query = "@assignment.outer", desc = "Select outer part of an assignment" },
|
||||
["i="] = { query = "@assignment.inner", desc = "Select inner part of an assignment" },
|
||||
["l="] = { query = "@assignment.lhs", desc = "Select left hand side of an assignment" },
|
||||
["r="] = { query = "@assignment.rhs", desc = "Select right hand side of an assignment" },
|
||||
|
||||
-- works for javascript/typescript files (custom capture I created in after/queries/ecma/textobjects.scm)
|
||||
["a:"] = { query = "@property.outer", desc = "Select outer part of an object property" },
|
||||
["i:"] = { query = "@property.inner", desc = "Select inner part of an object property" },
|
||||
["l:"] = { query = "@property.lhs", desc = "Select left part of an object property" },
|
||||
["r:"] = { query = "@property.rhs", desc = "Select right part of an object property" },
|
||||
|
||||
["aa"] = { query = "@parameter.outer", desc = "Select outer part of a parameter/argument" },
|
||||
["ia"] = { query = "@parameter.inner", desc = "Select inner part of a parameter/argument" },
|
||||
|
||||
["ai"] = { query = "@conditional.outer", desc = "Select outer part of a conditional" },
|
||||
["ii"] = { query = "@conditional.inner", desc = "Select inner part of a conditional" },
|
||||
|
||||
["al"] = { query = "@loop.outer", desc = "Select outer part of a loop" },
|
||||
["il"] = { query = "@loop.inner", desc = "Select inner part of a loop" },
|
||||
|
||||
["af"] = { query = "@call.outer", desc = "Select outer part of a function call" },
|
||||
["if"] = { query = "@call.inner", desc = "Select inner part of a function call" },
|
||||
|
||||
["am"] = { query = "@function.outer", desc = "Select outer part of a method/function definition" },
|
||||
["im"] = { query = "@function.inner", desc = "Select inner part of a method/function definition" },
|
||||
|
||||
["ac"] = { query = "@class.outer", desc = "Select outer part of a class" },
|
||||
["ic"] = { query = "@class.inner", desc = "Select inner part of a class" },
|
||||
},
|
||||
},
|
||||
swap = {
|
||||
enable = true,
|
||||
swap_next = {
|
||||
["<leader>na"] = "@parameter.inner", -- swap parameters/argument with next
|
||||
["<leader>n:"] = "@property.outer", -- swap object property with next
|
||||
["<leader>nm"] = "@function.outer", -- swap function with next
|
||||
},
|
||||
swap_previous = {
|
||||
["<leader>pa"] = "@parameter.inner", -- swap parameters/argument with prev
|
||||
["<leader>p:"] = "@property.outer", -- swap object property with prev
|
||||
["<leader>pm"] = "@function.outer", -- swap function with previous
|
||||
},
|
||||
},
|
||||
move = {
|
||||
enable = true,
|
||||
set_jumps = true, -- whether to set jumps in the jumplist
|
||||
goto_next_start = {
|
||||
["]f"] = { query = "@call.outer", desc = "Next function call start" },
|
||||
["]m"] = { query = "@function.outer", desc = "Next method/function def start" },
|
||||
["]c"] = { query = "@class.outer", desc = "Next class start" },
|
||||
["]i"] = { query = "@conditional.outer", desc = "Next conditional start" },
|
||||
["]l"] = { query = "@loop.outer", desc = "Next loop start" },
|
||||
|
||||
-- You can pass a query group to use query from `queries/<lang>/<query_group>.scm file in your runtime path.
|
||||
-- Below example nvim-treesitter's `locals.scm` and `folds.scm`. They also provide highlights.scm and indent.scm.
|
||||
["]s"] = { query = "@scope", query_group = "locals", desc = "Next scope" },
|
||||
["]z"] = { query = "@fold", query_group = "folds", desc = "Next fold" },
|
||||
},
|
||||
goto_next_end = {
|
||||
["]F"] = { query = "@call.outer", desc = "Next function call end" },
|
||||
["]M"] = { query = "@function.outer", desc = "Next method/function def end" },
|
||||
["]C"] = { query = "@class.outer", desc = "Next class end" },
|
||||
["]I"] = { query = "@conditional.outer", desc = "Next conditional end" },
|
||||
["]L"] = { query = "@loop.outer", desc = "Next loop end" },
|
||||
},
|
||||
goto_previous_start = {
|
||||
["[f"] = { query = "@call.outer", desc = "Prev function call start" },
|
||||
["[m"] = { query = "@function.outer", desc = "Prev method/function def start" },
|
||||
["[c"] = { query = "@class.outer", desc = "Prev class start" },
|
||||
["[i"] = { query = "@conditional.outer", desc = "Prev conditional start" },
|
||||
["[l"] = { query = "@loop.outer", desc = "Prev loop start" },
|
||||
},
|
||||
goto_previous_end = {
|
||||
["[F"] = { query = "@call.outer", desc = "Prev function call end" },
|
||||
["[M"] = { query = "@function.outer", desc = "Prev method/function def end" },
|
||||
["[C"] = { query = "@class.outer", desc = "Prev class end" },
|
||||
["[I"] = { query = "@conditional.outer", desc = "Prev conditional end" },
|
||||
["[L"] = { query = "@loop.outer", desc = "Prev loop end" },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
local ts_repeat_move = require("nvim-treesitter.textobjects.repeatable_move")
|
||||
|
||||
-- vim way: ; goes to the direction you were moving.
|
||||
vim.keymap.set({ "n", "x", "o" }, ";", ts_repeat_move.repeat_last_move)
|
||||
vim.keymap.set({ "n", "x", "o" }, ",", ts_repeat_move.repeat_last_move_opposite)
|
||||
|
||||
-- Optionally, make builtin f, F, t, T also repeatable with ; and ,
|
||||
vim.keymap.set({ "n", "x", "o" }, "f", ts_repeat_move.builtin_f)
|
||||
vim.keymap.set({ "n", "x", "o" }, "F", ts_repeat_move.builtin_F)
|
||||
vim.keymap.set({ "n", "x", "o" }, "t", ts_repeat_move.builtin_t)
|
||||
vim.keymap.set({ "n", "x", "o" }, "T", ts_repeat_move.builtin_T)
|
||||
end,
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
build = ":TSUpdate",
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
"windwp/nvim-ts-autotag",
|
||||
},
|
||||
config = function()
|
||||
-- import nvim-treesitter plugin
|
||||
local treesitter = require("nvim-treesitter.configs")
|
||||
|
||||
-- configure treesitter
|
||||
treesitter.setup({ -- enable syntax highlighting
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
-- enable indentation
|
||||
indent = { enable = true },
|
||||
-- enable autotagging (w/ nvim-ts-autotag plugin)
|
||||
autotag = {
|
||||
enable = true,
|
||||
},
|
||||
-- ensure these language parsers are installed
|
||||
ensure_installed = {
|
||||
"json",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"tsx",
|
||||
"yaml",
|
||||
"html",
|
||||
"css",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"graphql",
|
||||
"bash",
|
||||
"lua",
|
||||
"vim",
|
||||
"dockerfile",
|
||||
"gitignore",
|
||||
"query",
|
||||
"rust",
|
||||
"toml",
|
||||
"ron",
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<C-space>",
|
||||
node_incremental = "<C-space>",
|
||||
scope_incremental = false,
|
||||
node_decremental = "<bs>",
|
||||
},
|
||||
},
|
||||
-- enable nvim-ts-context-commentstring plugin for commenting tsx and jsx
|
||||
context_commentstring = {
|
||||
enable = true,
|
||||
enable_autocmd = false,
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
branch = "0.1.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
config = function()
|
||||
local telescope = require("telescope")
|
||||
local actions = require("telescope.actions")
|
||||
|
||||
telescope.setup({
|
||||
defaults = {
|
||||
path_display = { "truncate " },
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-k>"] = actions.move_selection_previous, -- move to prev result
|
||||
["<C-j>"] = actions.move_selection_next, -- move to next result
|
||||
["<C-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
telescope.load_extension("fzf")
|
||||
|
||||
-- set keymaps
|
||||
local keymap = vim.keymap -- for conciseness
|
||||
|
||||
keymap.set("n", "<leader>ff", "<cmd>Telescope find_files<cr>", { desc = "Fuzzy find files in cwd" })
|
||||
keymap.set("n", "<leader>fr", "<cmd>Telescope oldfiles<cr>", { desc = "Fuzzy find recent files" })
|
||||
keymap.set("n", "<leader>fs", "<cmd>Telescope live_grep<cr>", { desc = "Find string in cwd" })
|
||||
keymap.set("n", "<leader>fc", "<cmd>Telescope grep_string<cr>", { desc = "Find string under cursor in cwd" })
|
||||
end,
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
-- bootstrap lazy.nvim, LazyVim and your plugins
|
||||
require("config.lazy")
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"extras": [
|
||||
|
||||
],
|
||||
"news": {
|
||||
"NEWS.md": "2123"
|
||||
},
|
||||
"version": 2
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
-- 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
|
||||
@@ -1,3 +0,0 @@
|
||||
-- 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
|
||||
@@ -1,46 +0,0 @@
|
||||
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({
|
||||
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", "habamax" } },
|
||||
checker = { enabled = true }, -- automatically check for plugin updates
|
||||
performance = {
|
||||
rtp = {
|
||||
-- disable some rtp plugins
|
||||
disabled_plugins = {
|
||||
"gzip",
|
||||
-- "matchit",
|
||||
-- "matchparen",
|
||||
-- "netrwPlugin",
|
||||
"tarPlugin",
|
||||
"tohtml",
|
||||
"tutor",
|
||||
"zipPlugin",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
@@ -1,3 +0,0 @@
|
||||
-- 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
|
||||
@@ -1,265 +0,0 @@
|
||||
-- since this is just an example spec, don't actually load anything here and return an empty spec
|
||||
-- stylua: ignore
|
||||
if true then return {} end
|
||||
|
||||
-- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim
|
||||
--
|
||||
-- In your plugin files, you can:
|
||||
-- * add extra plugins
|
||||
-- * disable/enabled LazyVim plugins
|
||||
-- * override the configuration of LazyVim plugins
|
||||
return {
|
||||
-- add gruvbox
|
||||
{ "ellisonleao/gruvbox.nvim" },
|
||||
|
||||
-- Configure LazyVim to load gruvbox
|
||||
{
|
||||
"LazyVim/LazyVim",
|
||||
opts = {
|
||||
colorscheme = "gruvbox",
|
||||
},
|
||||
},
|
||||
|
||||
-- change trouble config
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
-- opts will be merged with the parent spec
|
||||
opts = { use_diagnostic_signs = true },
|
||||
},
|
||||
|
||||
-- disable trouble
|
||||
{ "folke/trouble.nvim", enabled = false },
|
||||
|
||||
-- add symbols-outline
|
||||
{
|
||||
"simrat39/symbols-outline.nvim",
|
||||
cmd = "SymbolsOutline",
|
||||
keys = { { "<leader>cs", "<cmd>SymbolsOutline<cr>", desc = "Symbols Outline" } },
|
||||
config = true,
|
||||
},
|
||||
|
||||
-- override nvim-cmp and add cmp-emoji
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = { "hrsh7th/cmp-emoji" },
|
||||
---@param opts cmp.ConfigSchema
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sources, { name = "emoji" })
|
||||
end,
|
||||
},
|
||||
|
||||
-- change some telescope options and a keymap to browse plugin files
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
keys = {
|
||||
-- add a keymap to browse plugin files
|
||||
-- stylua: ignore
|
||||
{
|
||||
"<leader>fp",
|
||||
function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end,
|
||||
desc = "Find Plugin File",
|
||||
},
|
||||
},
|
||||
-- change some options
|
||||
opts = {
|
||||
defaults = {
|
||||
layout_strategy = "horizontal",
|
||||
layout_config = { prompt_position = "top" },
|
||||
sorting_strategy = "ascending",
|
||||
winblend = 0,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- add telescope-fzf-native
|
||||
{
|
||||
"telescope.nvim",
|
||||
dependencies = {
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
build = "make",
|
||||
config = function()
|
||||
require("telescope").load_extension("fzf")
|
||||
end,
|
||||
},
|
||||
},
|
||||
|
||||
-- add pyright to lspconfig
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
---@class PluginLspOpts
|
||||
opts = {
|
||||
---@type lspconfig.options
|
||||
servers = {
|
||||
-- pyright will be automatically installed with mason and loaded with lspconfig
|
||||
pyright = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- add tsserver and setup with typescript.nvim instead of lspconfig
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
"jose-elias-alvarez/typescript.nvim",
|
||||
init = function()
|
||||
require("lazyvim.util").on_attach(function(_, buffer)
|
||||
-- stylua: ignore
|
||||
vim.keymap.set( "n", "<leader>co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" })
|
||||
vim.keymap.set("n", "<leader>cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer })
|
||||
end)
|
||||
end,
|
||||
},
|
||||
---@class PluginLspOpts
|
||||
opts = {
|
||||
---@type lspconfig.options
|
||||
servers = {
|
||||
-- tsserver will be automatically installed with mason and loaded with lspconfig
|
||||
tsserver = {},
|
||||
},
|
||||
-- you can do any additional lsp server setup here
|
||||
-- return true if you don't want this server to be setup with lspconfig
|
||||
---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
|
||||
setup = {
|
||||
-- example to setup with typescript.nvim
|
||||
tsserver = function(_, opts)
|
||||
require("typescript").setup({ server = opts })
|
||||
return true
|
||||
end,
|
||||
-- Specify * to use this function as a fallback for any server
|
||||
-- ["*"] = function(server, opts) end,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- for typescript, LazyVim also includes extra specs to properly setup lspconfig,
|
||||
-- treesitter, mason and typescript.nvim. So instead of the above, you can use:
|
||||
{ import = "lazyvim.plugins.extras.lang.typescript" },
|
||||
|
||||
-- add more treesitter parsers
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"html",
|
||||
"javascript",
|
||||
"json",
|
||||
"lua",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"python",
|
||||
"query",
|
||||
"regex",
|
||||
"tsx",
|
||||
"typescript",
|
||||
"vim",
|
||||
"yaml",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above
|
||||
-- would overwrite `ensure_installed` with the new value.
|
||||
-- If you'd rather extend the default config, use the code below instead:
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
-- add tsx and treesitter
|
||||
vim.list_extend(opts.ensure_installed, {
|
||||
"tsx",
|
||||
"typescript",
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- the opts function can also be used to change the default opts:
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sections.lualine_x, "😄")
|
||||
end,
|
||||
},
|
||||
|
||||
-- or you can return new options to override all the defaults
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = function()
|
||||
return {
|
||||
--[[add your custom lualine config here]]
|
||||
}
|
||||
end,
|
||||
},
|
||||
|
||||
-- use mini.starter instead of alpha
|
||||
{ import = "lazyvim.plugins.extras.ui.mini-starter" },
|
||||
|
||||
-- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc
|
||||
{ import = "lazyvim.plugins.extras.lang.json" },
|
||||
|
||||
-- add any tools you want to have installed below
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"stylua",
|
||||
"shellcheck",
|
||||
"shfmt",
|
||||
"flake8",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Use <tab> for completion and snippets (supertab)
|
||||
-- first: disable default <tab> and <s-tab> behavior in LuaSnip
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
keys = function()
|
||||
return {}
|
||||
end,
|
||||
},
|
||||
-- then: setup supertab in cmp
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-emoji",
|
||||
},
|
||||
---@param opts cmp.ConfigSchema
|
||||
opts = function(_, opts)
|
||||
local has_words_before = function()
|
||||
unpack = unpack or table.unpack
|
||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
||||
end
|
||||
|
||||
local luasnip = require("luasnip")
|
||||
local cmp = require("cmp")
|
||||
|
||||
opts.mapping = vim.tbl_extend("force", opts.mapping, {
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
-- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable()
|
||||
-- this way you will only jump inside the snippet region
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
elseif has_words_before() then
|
||||
cmp.complete()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
indent_type = "Spaces"
|
||||
indent_width = 2
|
||||
column_width = 120
|
||||
15
common/.gitignore
vendored
15
common/.gitignore
vendored
@@ -69,10 +69,21 @@ tasks/
|
||||
# ---- Programming Languages ----
|
||||
# Ignore all downloaded node modules
|
||||
node_modules/*
|
||||
|
||||
dist
|
||||
dist-ssr
|
||||
*.local
|
||||
# Ignore all minified js files
|
||||
*.min.js
|
||||
|
||||
# Log files
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
# Other Files to ignore
|
||||
**app_stat_v2.db
|
||||
.ssh/*.pub
|
||||
@@ -84,4 +95,4 @@ node_modules/*
|
||||
*.jsc
|
||||
**/contents/images
|
||||
**/contents/fonts
|
||||
*kpluginindex.json
|
||||
*kpluginindex.json
|
||||
|
||||
@@ -1,54 +1,86 @@
|
||||
" .ideavimrc is a configuration file for IdeaVim plugin. It uses
|
||||
" the same commands as the original .vimrc configuration.
|
||||
" You can find a list of commands here: https://jb.gg/h38q75
|
||||
" Find more examples here: https://jb.gg/share-ideavimrc
|
||||
" Examples to map IDE actions to IdeaVim -- https://jb.gg/abva4t
|
||||
" Enable IdeaVim plugins https://jb.gg/ideavim-plugins
|
||||
|
||||
" Source your .vimrc
|
||||
source ~/.vimrc
|
||||
" Source .vimrc
|
||||
"source ~/.vimrc
|
||||
|
||||
"" -- Suggested options --
|
||||
" Show a few lines of context around the cursor. Note that this makes the
|
||||
" text scroll if you mouse-click near the start or end of the window.
|
||||
set scrolloff=5
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Searches
|
||||
set hlsearch " highlight search occurrences
|
||||
set ignorecase " ignore case in search patterns
|
||||
set smartcase " no ignore case when pattern is uppercase
|
||||
set incsearch " show search results while typing
|
||||
set wrapscan " searches wrap around the end of the file
|
||||
|
||||
" Quick scope for motions with f, t, F & T
|
||||
" https://plugins.jetbrains.com/plugin/19417-ideavim-quickscope
|
||||
" set quickscope
|
||||
" common settings
|
||||
set gdefault " substitute all occurrences in line
|
||||
set history=10000 " command line history
|
||||
set scrolloff=5 sidescrolloff=10 " Keep some line before and after the cursor visible
|
||||
set clipboard^=unnamed,unnamedplus,ideaput " Copy to and from system clipboard
|
||||
|
||||
" Do incremental searching.
|
||||
set incsearch
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
"keymaps
|
||||
let mapleader = " "
|
||||
|
||||
" Don't use Ex mode, use Q for formatting.
|
||||
" Don't use Ex mode, use Q for formatting
|
||||
map Q gq
|
||||
|
||||
" Copy to and from system clipboard
|
||||
set clipboard^=unnamed,unnamedplus
|
||||
|
||||
" --- Enable IdeaVim plugins https://jb.gg/ideavim-plugins
|
||||
|
||||
" Highlight copied text
|
||||
Plug 'machakann/vim-highlightedyank'
|
||||
" Commentary plugin
|
||||
Plug 'tpope/vim-commentary'
|
||||
" Surround Plugin
|
||||
Plug 'tpope/vim-surround'
|
||||
" Repeat for Surround
|
||||
Plug 'tpope/vim-repeat'
|
||||
" Paragraph Motion
|
||||
Plug 'dbakker/vim-paragraph-motion'
|
||||
" Git gutter icons
|
||||
Plug 'airblade/vim-gitgutter',
|
||||
|
||||
"" -- Map IDE actions to IdeaVim -- https://jb.gg/abva4t
|
||||
"" Map \r to the Reformat Code action
|
||||
map \r <Action>(ReformatCode)
|
||||
|
||||
"" Map <leader>d to start debug
|
||||
" Map <leader>d to start debug
|
||||
"map <leader>d <Action>(Debug)
|
||||
|
||||
"" Map \b to toggle the breakpoint on the current line
|
||||
" Map \b to toggle breakpoint
|
||||
"map \b <Action>(ToggleLineBreakpoint)
|
||||
|
||||
" Center the cursor when doing 1/2 page down and page up
|
||||
nnoremap <C-d> <C-d>zz
|
||||
nnoremap <C-u> <C-u>zz
|
||||
nnoremap <C-u> <C-u>zz
|
||||
|
||||
" clear search highlighting
|
||||
nnoremap <leader>/ :nohls<return><esc>
|
||||
|
||||
" code navigations
|
||||
nmap <leader>e :action GotoFile<CR>
|
||||
nmap <leader>a :action FindInPath<CR>
|
||||
nmap gr :action ShowUsages<CR>
|
||||
nmap gi :action GotoImplementation<CR>
|
||||
nmap gs :action GotoSuperMethod<CR>
|
||||
nmap <leader>tn :action NextTab<CR>
|
||||
nmap <leader>tp :action PreviousTab<CR>
|
||||
|
||||
nmap <C-p> :action ParameterInfo<CR>
|
||||
imap <C-p> <C-o>:action ParameterInfo<CR>
|
||||
nmap <leader>n :action GotoNextError<CR>
|
||||
map gh <Action>(ShowErrorDescription)
|
||||
|
||||
" code refactoring
|
||||
nmap <leader>ri :action Inline<CR>
|
||||
nmap <leader>rr :action RenameElement<CR>
|
||||
nmap <leader>rev :action IntroduceVariable<CR>
|
||||
vmap <leader>rev :action IntroduceVariable<CR>
|
||||
nmap <leader>rem :action ExtractMethod<CR>
|
||||
vmap <leader>rem :action ExtractMethod<CR>
|
||||
nmap <leader>rm :action Move<CR>
|
||||
nmap <leader>ro :action OptimizeImports<CR>
|
||||
nmap <leader>rG :action Generate<CR>
|
||||
nmap <leader>rf :action ReformatCode<CR>
|
||||
|
||||
" Easy motion
|
||||
map <leader>J <Plug>(easymotion-s)
|
||||
map <leader>j <Plug>(easymotion-f)
|
||||
|
||||
nmap <leader>gr :action Vcs.RollbackChangedLines<CR>
|
||||
|
||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Enabled plugins
|
||||
set ideajoin
|
||||
Plug 'easymotion/vim-easymotion'
|
||||
Plug 'preservim/NERDTree'
|
||||
Plug 'tpope/surround'
|
||||
Plug 'tpope/commentary'
|
||||
Plug 'machakann/highlightedyank'
|
||||
Plug 'dbakker/vim-paragraph-motion'
|
||||
Plug 'chrisbra/matchit'
|
||||
Plug 'tpope/vim-repeat' " Repeat for Surround
|
||||
Plug 'airblade/vim-gitgutter' " Git gutter icons
|
||||
Plug 'mg979/vim-visual-multi' " Multi Line Editing
|
||||
|
||||
@@ -25,3 +25,6 @@ fi
|
||||
if [ -d "$HOME/.local/bin" ] ; then
|
||||
PATH="$HOME/.local/bin:$PATH"
|
||||
fi
|
||||
|
||||
# Remap caps lock to escape
|
||||
setxkbmap -option caps:escape
|
||||
@@ -60,6 +60,7 @@ plugins=(
|
||||
systemd
|
||||
zsh-syntax-highlighting
|
||||
zsh-autosuggestions
|
||||
vi-mode
|
||||
# exercism
|
||||
)
|
||||
|
||||
@@ -71,7 +72,6 @@ source $ZSH/oh-my-zsh.sh
|
||||
POWERLEVEL9K_INSTANT_PROMPT=off
|
||||
|
||||
POWERLEVEL9K_SHORTEN_DIR_LENGTH=4
|
||||
# POWERLEVEL9K_SHORTEN_STRATEGY="None"
|
||||
POWERLEVEL9K_TIME_FORMAT="%D{%H:%M:%S %a}"
|
||||
POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=0
|
||||
POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=6
|
||||
@@ -99,6 +99,9 @@ setopt HIST_IGNORE_SPACE # Don't add commands that start with whitespac
|
||||
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
|
||||
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
|
||||
|
||||
# enable vi-mode
|
||||
bindkey -v
|
||||
|
||||
# Setup path and export variables
|
||||
[[ ! -f ~/.env ]] || source ~/.env
|
||||
[[ ! -f ~/.set_path ]] || source ~/.set_path
|
||||
@@ -122,4 +125,4 @@ export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || pr
|
||||
[[ ! -f ~/.config/exercism/exercism_completion.bash ]] || source ~/.config/exercism/exercism_completion.bash
|
||||
|
||||
eval "$(ssh-agent -s)" > /dev/null
|
||||
ulimit -n 10240
|
||||
ulimit -n 10240
|
||||
|
||||
Reference in New Issue
Block a user