mirror of
https://github.com/pratiktri/dotfiles.git
synced 2026-02-04 08:41:43 +05:30
NVIM Configuration Enhancements
- VIM: Keybindings for better coding - Gitignore in common is now a hardlinked to the root one - NVIM: Bash Alias added for Nvim - VIM: settings added from VIM-sensible and Primeagen - NVIM: Moved autocommands, keybindings & configurations specific to NVIM to lua/config - Wezterm, tmux configured. - Generic: Configurations moved inside $HOME/.config/ directory - Generic: All aliases renamed to similar names. - Generic: Relevant aliases added for reaching git root
This commit is contained in:
71
.gitignore
vendored
71
.gitignore
vendored
@@ -1,3 +1,23 @@
|
||||
# ---- KDE Neon ----
|
||||
# KDE directory preferences
|
||||
.directory
|
||||
|
||||
# temporary files which can be created if a process still has a handle open of a deleted file
|
||||
.fuse_hidden*
|
||||
|
||||
# Linux trash folder which might appear on any partition or disk
|
||||
.Trash-*
|
||||
|
||||
# .nfs files are created when an open file is removed but is still being accessed
|
||||
.nfs*
|
||||
|
||||
# Binaries for programs and plugins
|
||||
*.exe
|
||||
*.exe~
|
||||
*.dll
|
||||
*.so
|
||||
*.dylib
|
||||
|
||||
# ---- macOS ----
|
||||
# General
|
||||
.DS_Store
|
||||
@@ -26,57 +46,45 @@ Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
|
||||
# ---- KDE Neon ----
|
||||
# KDE directory preferences
|
||||
.directory
|
||||
|
||||
# temporary files which can be created if a process still has a handle open of a deleted file
|
||||
.fuse_hidden*
|
||||
|
||||
# Linux trash folder which might appear on any partition or disk
|
||||
.Trash-*
|
||||
|
||||
# .nfs files are created when an open file is removed but is still being accessed
|
||||
.nfs*
|
||||
|
||||
# Binaries for programs and plugins
|
||||
*.exe
|
||||
*.exe~
|
||||
*.dll
|
||||
*.so
|
||||
*.dylib
|
||||
|
||||
# ---- IDE ----
|
||||
# Vim Artifacts
|
||||
**.swp
|
||||
lazy-lock.json
|
||||
.luarc.json
|
||||
|
||||
# VS Code Artifacts
|
||||
.vscode
|
||||
/.vscode/
|
||||
**state.vscdb
|
||||
**state.vscdb.backup
|
||||
.vscode/extensions/** # Ignore all Files under .vscode/extensions/
|
||||
!.vscode/extensions/**/*.json # Only json files inside the .vscode/extensions/ folder
|
||||
|
||||
# Intellij IDE Artifacts
|
||||
**.idea/
|
||||
.idea/
|
||||
*.imi
|
||||
*.jar
|
||||
*.tar
|
||||
|
||||
# Vim Artifacts
|
||||
*.swp
|
||||
|
||||
# NVIM Artifacts
|
||||
*.luarc.json
|
||||
|
||||
resharper-host/
|
||||
tasks/
|
||||
|
||||
# ---- Programming Languages ----
|
||||
# Ignore all downloaded node modules
|
||||
node_modules/*
|
||||
**lock.json
|
||||
|
||||
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
|
||||
@@ -89,3 +97,4 @@ node_modules/*
|
||||
**/contents/images
|
||||
**/contents/fonts
|
||||
*kpluginindex.json
|
||||
|
||||
|
||||
@@ -19,3 +19,6 @@ Example: bash ./bootstrap.sh -q --create-links
|
||||
## Why `--create-links`?
|
||||
|
||||
I have multiple Linux installations on my machine. Linking it from one place (this repository) keeps things tidy. Also, changes to dotfiles automatically get applied to all the distros.
|
||||
|
||||
<!-- TODO: Move as many dotfiles inside ~/.config as possible -->
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/bin/sh
|
||||
|
||||
usage() {
|
||||
if [ -n "$1" ]; then
|
||||
|
||||
@@ -5,8 +5,8 @@ alias sb="source ~/.bashrc"
|
||||
alias bashreload="source ~/.bashrc"
|
||||
alias sz="source ~/.zshrc"
|
||||
alias zshreload="source ~/.zshrc"
|
||||
alias bashrc="${EDITOR:-nano} +116 ~/.bashrc"
|
||||
alias zshrc="${EDITOR:-nano} ~/.zshrc"
|
||||
alias bashrc="${EDITOR:-vim} +116 ~/.bashrc"
|
||||
alias zshrc="${EDITOR:-vim} ~/.zshrc"
|
||||
alias free="free -ht"
|
||||
alias type="type -a"
|
||||
alias grep='grep --color=auto'
|
||||
@@ -14,6 +14,8 @@ alias egrep='egrep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
alias usersearch="awk -F: '{print \"UserName: \" \$1 \", UserID: \" \$3 \", Home Dir: \" \$6 \", Shell Used: \" \$7}' /etc/passwd | grep"
|
||||
alias untar='tar -zxvf '
|
||||
alias v=nvim
|
||||
alias n=nvim
|
||||
|
||||
url_encode(){
|
||||
python3 -c "import urllib.parse, sys; print(urllib.parse.quote(sys.stdin.read()))" <<< "$1"
|
||||
@@ -30,9 +32,10 @@ alias hsi="histsearch"
|
||||
alias ~="cd ~"
|
||||
alias ..="cd .."
|
||||
alias ...='cd ../../../' # Go back 3 directory levels
|
||||
alias ..4='cd ../../../../' # Go back 4 directory levels
|
||||
alias ..5='cd ../../../../../' # Go back 5 directory levels
|
||||
alias ..6='cd ../../../../../../' # Go back 6 directory levels
|
||||
alias cd_root='cd $(git rev-parse --show-toplevel 2>/dev/null || echo ".")'
|
||||
alias cd_git_root=cd_root
|
||||
alias c=clear
|
||||
alias cl=clear
|
||||
alias lsc='ls --color=auto'
|
||||
alias ll='lsc -alhF'
|
||||
alias la='lsc -Ah'
|
||||
|
||||
@@ -194,8 +194,8 @@ jazz_my_prompt() {
|
||||
|
||||
# Aliases
|
||||
[[ ! -f ~/.aliases ]] || source ~/.aliases
|
||||
[[ ! -f ~/.mac_aliases ]] || source ~/.mac_aliases
|
||||
[[ ! -f ~/.neon_aliases ]] || source ~/.neon_aliases
|
||||
[[ ! -f ~/.aliases_mac ]] || source ~/.aliases_mac
|
||||
[[ ! -f ~/.aliases_neon ]] || source ~/.aliases_neon
|
||||
[[ ! -f ~/.aliases_personal ]] || source ~/.aliases_personal
|
||||
|
||||
# nvm Setup
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
-- TODO: Todo-Comments: Highlight TODOs
|
||||
-- TODO: Neo-Tree: reduce size, hidden visible by default, set vcs root at pwd+cwd
|
||||
-- TODO: Telescope: open in a new window -> vertial & horizontal
|
||||
-- TODO: LSPConfig: Standardize keymaps to <leader>d[x]
|
||||
-- TODO: Note what exactly Treesitter does???
|
||||
-- TODO: Git: Add a plugin
|
||||
-- TODO: System install and setup lazygit
|
||||
-- TODO: Setup auto complete
|
||||
-- TODO: Provide description to each keymap
|
||||
-- TODO: tpope/vim-obsession configure to work with tmux-resurrection
|
||||
-- TODO: Check why Nvim can't find todos
|
||||
-- TODO: Put all plugin configs inside /after/plugin directory
|
||||
|
||||
-- Loads the system's Vim configs: keeps the VIM & NVim configs in sync
|
||||
local vimrc = vim.fn.stdpath("config") .. "/vim-sync.vim"
|
||||
@@ -23,9 +25,15 @@ if not vim.loop.fs_stat(lazypath) then
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require("lazy").setup("plugins", {
|
||||
change_detection = {
|
||||
enabled = true,
|
||||
notify = false
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
require("configs.autocommands")
|
||||
require("configs.configs")
|
||||
require("configs.keymaps")
|
||||
|
||||
|
||||
10
common/.config/nvim/lua/configs/autocommands.lua
Normal file
10
common/.config/nvim/lua/configs/autocommands.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
-- [[ Highlight on yank ]]
|
||||
local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true })
|
||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
group = highlight_group,
|
||||
pattern = '*',
|
||||
})
|
||||
|
||||
2
common/.config/nvim/lua/configs/configs.lua
Normal file
2
common/.config/nvim/lua/configs/configs.lua
Normal file
@@ -0,0 +1,2 @@
|
||||
-- Nvim Specific Configs that don't apply to VIM
|
||||
|
||||
9
common/.config/nvim/lua/configs/keymaps.lua
Normal file
9
common/.config/nvim/lua/configs/keymaps.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
-- <Ctrl-Alt-s> -> to save all files
|
||||
vim.keymap.set({ "n", "i", "v" }, "<C-M-s>", "<cmd>wa<CR>", {})
|
||||
-- <Ctrl-q> -> Save all files and quit Nvim
|
||||
vim.keymap.set({ "n", "i", "v" }, "<C-q>", "<cmd>wqa<CR>", {})
|
||||
|
||||
-- Remap for dealing with word wrap
|
||||
vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
||||
vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
-- Keeps the plugin list that Lazy uses at one place
|
||||
return {
|
||||
-- From VIM
|
||||
{ "tpope/vim-sensible" },
|
||||
{ "tpope/vim-fugitive" },
|
||||
{ "tpope/vim-surround" },
|
||||
{ "tpope/vim-repeat" },
|
||||
{ "tpope/vim-commentary" },
|
||||
{ "tpope/vim-sensible" },
|
||||
{ "rstacruz/vim-closer" },
|
||||
{ "machakann/vim-highlightedyank" },
|
||||
{ "airblade/vim-gitgutter" },
|
||||
{ "easymotion/vim-easymotion" },
|
||||
{ "preservim/nerdtree" },
|
||||
-- { 'itchyny/lightline.vim' },
|
||||
{ "tpope/vim-obsession" },
|
||||
{ "mg979/vim-visual-multi" },
|
||||
}
|
||||
|
||||
17
common/.config/nvim/lua/plugins/bufferline.lua
Normal file
17
common/.config/nvim/lua/plugins/bufferline.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
return {
|
||||
-- TODO: Throws git pull issue when downloading through Lazy
|
||||
-- "askinsho/bufferline.nvim",
|
||||
-- dependencies = "nvim-tree/nvim-web-devicons",
|
||||
-- config = function()
|
||||
-- require("bufferline").setup({
|
||||
-- options = {
|
||||
-- indicator = { style = "underline" },
|
||||
-- }
|
||||
-- })
|
||||
|
||||
-- vim.keymap.set('n', '<tab>', ":BufferLineCycleNext<CR>")
|
||||
-- vim.keymap.set('n', '<S-tab>', ":BufferLineCyclePrev<CR>")
|
||||
-- vim.keymap.set('n', '<leader>bo', ":BufferLineCloseOthers<CR>")
|
||||
-- vim.keymap.set('n', '<leader>bp', ":BufferLinePick<CR>")
|
||||
-- end
|
||||
}
|
||||
40
common/.config/nvim/lua/plugins/coding-highlighting.lua
Normal file
40
common/.config/nvim/lua/plugins/coding-highlighting.lua
Normal file
@@ -0,0 +1,40 @@
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
local tree_config = require("nvim-treesitter.configs")
|
||||
tree_config.setup({
|
||||
auto_install = true,
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<C-space>",
|
||||
node_incremental = "<C-space>",
|
||||
scope_incremental = "<C-CR>",
|
||||
node_decremental = "<bs>",
|
||||
}
|
||||
}
|
||||
})
|
||||
end
|
||||
},
|
||||
{
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
main = "ibl",
|
||||
config = function()
|
||||
require("ibl").setup({})
|
||||
end
|
||||
},
|
||||
-- { "windwp/nvim-autopairs" },
|
||||
-- {
|
||||
-- "akinsho/toggleterm.nvim",
|
||||
-- version = "*",
|
||||
-- config = function ()
|
||||
-- require("toggleterm").setup({})
|
||||
-- end
|
||||
-- },
|
||||
}
|
||||
|
||||
|
||||
116
common/.config/nvim/lua/plugins/coding-lsp.lua
Normal file
116
common/.config/nvim/lua/plugins/coding-lsp.lua
Normal file
@@ -0,0 +1,116 @@
|
||||
return {
|
||||
-- TODO: Configure following plugins in separate files
|
||||
|
||||
-- LSP Configuration
|
||||
{
|
||||
-- Provides :Mason command which installs Language Servers
|
||||
"williamboman/mason.nvim",
|
||||
config = function()
|
||||
require("mason").setup()
|
||||
end
|
||||
},
|
||||
{
|
||||
-- Helps to auto install Language Servers by specifying them
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
config = function()
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = {
|
||||
"lua_ls", "bashls", "cssls", "dockerls", "emmet_ls", "jsonls", "tsserver", "marksman",
|
||||
"pyre", "rust_analyzer", "sqlls", "taplo"
|
||||
}
|
||||
})
|
||||
end
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
config = function()
|
||||
-- Hook up NVIM with the above installed Language Servers
|
||||
local lspconfig = require("lspconfig")
|
||||
lspconfig.lua_ls.setup({})
|
||||
lspconfig.bashls.setup({})
|
||||
lspconfig.cssls.setup({})
|
||||
lspconfig.dockerls.setup({})
|
||||
lspconfig.emmet_ls.setup({})
|
||||
lspconfig.jsonls.setup({})
|
||||
lspconfig.tsserver.setup({})
|
||||
lspconfig.marksman.setup({})
|
||||
lspconfig.pyre.setup({})
|
||||
lspconfig.rust_analyzer.setup({})
|
||||
lspconfig.sqlls.setup({})
|
||||
lspconfig.taplo.setup({})
|
||||
|
||||
-- LSP Keybindings
|
||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev)
|
||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
|
||||
vim.keymap.set({ 'n', 'v' }, '<leader>ca', vim.lsp.buf.code_action, {})
|
||||
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist)
|
||||
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, {})
|
||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, {})
|
||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, {})
|
||||
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, {})
|
||||
-- vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, {})
|
||||
vim.keymap.set('n', '<leader>wa', vim.lsp.buf.add_workspace_folder, {})
|
||||
vim.keymap.set('n', '<leader>wr', vim.lsp.buf.remove_workspace_folder, {})
|
||||
vim.keymap.set('n', '<leader>wl', function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, {})
|
||||
vim.keymap.set('n', '<leader>D', vim.lsp.buf.type_definition, {})
|
||||
vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, {})
|
||||
vim.keymap.set('n', 'gr', vim.lsp.buf.references, {})
|
||||
vim.keymap.set('n', '<leader>f', function()
|
||||
vim.lsp.buf.format { async = true }
|
||||
end, {})
|
||||
end
|
||||
},
|
||||
|
||||
-- None-ls
|
||||
{
|
||||
"nvimtools/none-ls.nvim",
|
||||
config = function()
|
||||
local null_ls = require("null-ls")
|
||||
|
||||
null_ls.setup({
|
||||
sources = {
|
||||
-- TODO: Segement these by language & Install required ones through :Mason
|
||||
-- null_ls.builtins.formatting.stylua,
|
||||
-- null_ls.builtins.formatting.beautysh,
|
||||
-- null_ls.builtins.formatting.csharpier,
|
||||
-- null_ls.builtins.formatting.jq,
|
||||
-- null_ls.builtins.formatting.markdownlint_toc,
|
||||
-- null_ls.builtins.formatting.nginx_beautifier,
|
||||
-- null_ls.builtins.formatting.pg_format,
|
||||
-- null_ls.builtins.formatting.prettierd,
|
||||
-- null_ls.builtins.formatting.protolint,
|
||||
-- null_ls.builtins.formatting.rustfmt,
|
||||
-- null_ls.builtins.formatting.shellharden,
|
||||
-- null_ls.builtins.formatting.shfmt,
|
||||
|
||||
-- null_ls.builtins.diagnostics.alex,
|
||||
-- null_ls.builtins.diagnostics.codespell,
|
||||
-- null_ls.builtins.diagnostics.eslint_d,
|
||||
-- null_ls.builtins.diagnostics.jsonlint,
|
||||
-- null_ls.builtins.diagnostics.luacheck,
|
||||
-- null_ls.builtins.diagnostics.protolint,
|
||||
-- null_ls.builtins.diagnostics.shellcheck,
|
||||
-- null_ls.builtins.diagnostics.stylelint,
|
||||
-- null_ls.builtins.diagnostics.tidy,
|
||||
-- null_ls.builtins.diagnostics.tsc,
|
||||
-- null_ls.builtins.diagnostics.vlint,
|
||||
-- null_ls.builtins.diagnostics.yamllint,
|
||||
|
||||
-- null_ls.builtins.code_actions.gitsigns,
|
||||
-- null_ls.builtins.code_actions.eslint_d,
|
||||
-- null_ls.builtins.code_actions.refactoring,
|
||||
-- null_ls.builtins.code_actions.shellcheck,
|
||||
|
||||
-- null_ls.builtins.completion.spell,
|
||||
-- null_ls.builtins.completion.tags,
|
||||
-- null_ls.builtins.completion.luasnip,
|
||||
}
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>gf", vim.lsp.buf.format, {})
|
||||
end
|
||||
},
|
||||
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
local tree_config = require("nvim-treesitter.configs")
|
||||
tree_config.setup({
|
||||
ensure_installed = { "lua", "vim", "vimdoc", "bash", "c_sharp", "css", "dockerfile", "git_config", "gitignore", "html", "http", "ini", "json", "proto", "python", "rust", "sql", "toml", "tsx", "typescript" , "javascript" },
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
})
|
||||
end
|
||||
},
|
||||
|
||||
-- LSP Configuration
|
||||
{
|
||||
-- Provides :Mason command which installs Language Servers
|
||||
"williamboman/mason.nvim",
|
||||
config = function()
|
||||
require("mason").setup()
|
||||
end
|
||||
},
|
||||
{
|
||||
-- Helps to auto install Language Servers by specifying them
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
config = function()
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = { "lua_ls", "bashls", "cssls", "dockerls", "emmet_ls", "jsonls", "tsserver", "marksman", "pyre", "rust_analyzer", "sqlls", "taplo" }
|
||||
})
|
||||
end
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
config = function()
|
||||
-- Hook up NVIM with the above installed Language Servers
|
||||
local lspconfig = require("lspconfig")
|
||||
lspconfig.lua_ls.setup({})
|
||||
lspconfig.bashls.setup({})
|
||||
lspconfig.cssls.setup({})
|
||||
lspconfig.dockerls.setup({})
|
||||
lspconfig.emmet_ls.setup({})
|
||||
lspconfig.jsonls.setup({})
|
||||
lspconfig.tsserver.setup({})
|
||||
lspconfig.marksman.setup({})
|
||||
lspconfig.pyre.setup({})
|
||||
lspconfig.rust_analyzer.setup({})
|
||||
lspconfig.sqlls.setup({})
|
||||
lspconfig.taplo.setup({})
|
||||
|
||||
-- LSP Keybindings
|
||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev)
|
||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
|
||||
vim.keymap.set({ 'n', 'v' }, '<leader>ca', vim.lsp.buf.code_action, {})
|
||||
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist)
|
||||
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, {})
|
||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, {})
|
||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, {})
|
||||
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, {})
|
||||
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, {})
|
||||
vim.keymap.set('n', '<leader>wa', vim.lsp.buf.add_workspace_folder, {})
|
||||
vim.keymap.set('n', '<leader>wr', vim.lsp.buf.remove_workspace_folder, {})
|
||||
vim.keymap.set('n', '<leader>wl', function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, {})
|
||||
vim.keymap.set('n', '<leader>D', vim.lsp.buf.type_definition, {})
|
||||
vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, {})
|
||||
vim.keymap.set('n', 'gr', vim.lsp.buf.references, {})
|
||||
vim.keymap.set('n', '<leader>f', function()
|
||||
vim.lsp.buf.format { async = true }
|
||||
end, {})
|
||||
end
|
||||
}
|
||||
}
|
||||
@@ -12,19 +12,16 @@ return {
|
||||
"catppuccin/nvim",
|
||||
name = "catppuccin",
|
||||
priority = 1000,
|
||||
-- config = function()
|
||||
-- show_end_of_buffer = true,
|
||||
-- integrations = {
|
||||
-- cmp = true,
|
||||
-- gitsigns = true,
|
||||
-- nvimtree = true,
|
||||
-- },
|
||||
-- vim.cmd.colorscheme "catppuccin-macchiato",
|
||||
-- end
|
||||
},
|
||||
{
|
||||
"rose-pine/neovim",
|
||||
name = "rose-pine",
|
||||
priority = 1000,
|
||||
config = function()
|
||||
require("catppuccin").setup({
|
||||
show_end_of_buffer = true,
|
||||
integrations = {
|
||||
cmp = true,
|
||||
gitsigns = true,
|
||||
nvimtree = true,
|
||||
},
|
||||
})
|
||||
-- vim.cmd.colorscheme "catppuccin-mocha"
|
||||
end
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,9 +1,20 @@
|
||||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
config = function()
|
||||
local lazy_status = require("lazy.status")
|
||||
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
theme = "powerline_dark"
|
||||
-- theme = "horizon",
|
||||
-- TODO: Following ain't taking effect. Why?
|
||||
sections = {
|
||||
lualine_a = {'mode','filename'},
|
||||
lualine_b = {'branch'},
|
||||
lualine_c = {'diff', 'diagnostics'},
|
||||
lualine_x = { { lazy_status.updates, cond = lazy_status.has_updates } },
|
||||
lualine_y = {'progress'},
|
||||
lualine_z = {'location', 'searchcount'}
|
||||
},
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
@@ -1,13 +1,50 @@
|
||||
return {
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
"MunifTanjim/nui.nvim",
|
||||
{
|
||||
"airblade/vim-rooter",
|
||||
config = function()
|
||||
vim.g.rooter_cd_cmd = "tcd"
|
||||
end
|
||||
},
|
||||
config = function()
|
||||
-- Keymaps for Neotree
|
||||
vim.keymap.set("n", "<Leader>n", ":lcd %:h <BAR>:Neotree filesystem reveal left<CR>")
|
||||
end
|
||||
{
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
config = function()
|
||||
require("neo-tree").setup({
|
||||
filesystem = {
|
||||
follow_current_file = {
|
||||
enabled = true, -- Highlight the current buffer
|
||||
leave_dirs_open = true,
|
||||
},
|
||||
use_libuv_file_watcher = true, -- Sync file system changes
|
||||
filtered_items = {
|
||||
visible = true,
|
||||
show_hidden_count = true,
|
||||
hide_dotfile = false,
|
||||
hide_gitignore = false
|
||||
},
|
||||
},
|
||||
window = {
|
||||
position = "left",
|
||||
width = 25, -- Saner window size
|
||||
mappings = {
|
||||
["s"] = "open_split", -- Default vim keymap for horizontal split
|
||||
["v"] = "open_vsplit" -- Default vim keymap for vertical split
|
||||
}
|
||||
},
|
||||
default_component_configs = {
|
||||
indent = {
|
||||
indent_size = 1, -- Compact tree display
|
||||
padding = 0 -- Compact tree display
|
||||
}
|
||||
}
|
||||
})
|
||||
-- Keymaps for Neotree
|
||||
vim.keymap.set("n", "<Leader>e", ":Neotree filesystem toggle<CR>")
|
||||
end
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,51 @@
|
||||
return {
|
||||
{
|
||||
'nvim-telescope/telescope.nvim', tag = '0.1.5',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
"nvim-telescope/telescope.nvim", tag = "0.1.5",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"neovim/nvim-lspconfig",
|
||||
"nvim-tree/nvim-web-devicons"
|
||||
},
|
||||
config = function()
|
||||
local actions = require("telescope.actions")
|
||||
|
||||
require("telescope").setup({
|
||||
pickers = {
|
||||
find_files = {
|
||||
mappings = {
|
||||
i = {
|
||||
-- Ctrl + s to open in horizontal split
|
||||
["<C-s>"] = actions.select_horizontal
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
require("telescope").load_extension("fzf")
|
||||
|
||||
-- Keymaps for Telescope
|
||||
local builtin = require("telescope.builtin")
|
||||
vim.keymap.set("n", "<Leader>ff", builtin.find_files, {})
|
||||
vim.keymap.set("n", "<Leader>fg", builtin.live_grep, {})
|
||||
vim.keymap.set("n", "<Leader>fb", builtin.buffers, {})
|
||||
vim.keymap.set("n", "<leader>ff", "<cmd>lua require'telescope.builtin'.find_files({ find_command = {'rg', '--files', '--hidden', '-g', '!{**/.git/*,**/node_modules/*,**/package-lock.json,**/yarn.lock}' }})<cr>", {})
|
||||
-- TODO: Live grep ain't working
|
||||
-- vim.keymap.set("n", "<Leader>fl", builtin.live_grep, {})
|
||||
vim.keymap.set("n", "<Leader>fm", builtin.marks, {})
|
||||
vim.keymap.set("n", "<Leader>fc", builtin.colorscheme, {})
|
||||
vim.keymap.set("n", "<Leader>fr", builtin.registers, {})
|
||||
vim.keymap.set("n", "<Leader>fs", builtin.lsp_document_symbols, {})
|
||||
vim.keymap.set("n", "<Leader>fw", builtin.grep_string, {})
|
||||
vim.keymap.set("n", "<Leader>fg", "<cmd>AdvancedGitSearch<CR>", {})
|
||||
vim.keymap.set("n", "<Leader>ft", builtin.treesitter, {})
|
||||
-- TODO: Find TODO ain't working either
|
||||
vim.keymap.set("n", "<Leader>fd", ":TodoTelescope<CR>", {})
|
||||
end
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build'
|
||||
},
|
||||
{
|
||||
-- For displaying LSP Code Actions
|
||||
"nvim-telescope/telescope-ui-select.nvim",
|
||||
config = function()
|
||||
require("telescope").setup({
|
||||
@@ -23,5 +58,11 @@ return {
|
||||
})
|
||||
require("telescope").load_extension("ui-select")
|
||||
end
|
||||
},
|
||||
{
|
||||
"aaronhallaert/advanced-git-search.nvim",
|
||||
config = function()
|
||||
require("telescope").load_extension("advanced_git_search")
|
||||
end
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,19 +2,15 @@ return {
|
||||
"folke/todo-comments.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
require("todo-comments").setup({})
|
||||
|
||||
vim.keymap.set("n", "]t", function()
|
||||
require("todo-comments").jump_next(
|
||||
{ keywords = { "ERROR", "WARNING", "TODO" }}
|
||||
)
|
||||
end,
|
||||
{ desc = "Next todo comment"}
|
||||
require("todo-comments").jump_next()
|
||||
end, { desc = "Next todo comment" }
|
||||
)
|
||||
vim.keymap.set("n", "[t", function()
|
||||
require("todo-comments").jump_prev(
|
||||
{ keywords = { "ERROR", "WARNING", "TODO" }}
|
||||
)
|
||||
end,
|
||||
{ desc = "Previous todo comment"}
|
||||
require("todo-comments").jump_prev()
|
||||
end, { desc = "Previous todo comment" }
|
||||
)
|
||||
end
|
||||
}
|
||||
|
||||
6
common/.config/nvim/lua/plugins/undotree.lua
Normal file
6
common/.config/nvim/lua/plugins/undotree.lua
Normal file
@@ -0,0 +1,6 @@
|
||||
return{
|
||||
"mbbill/undotree",
|
||||
config = function()
|
||||
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
|
||||
end
|
||||
}
|
||||
7
common/.config/nvim/lua/plugins/vim-tmux-navigator.lua
Normal file
7
common/.config/nvim/lua/plugins/vim-tmux-navigator.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
return {
|
||||
"christoomey/vim-tmux-navigator",
|
||||
lazy = false,
|
||||
config = function()
|
||||
|
||||
end
|
||||
}
|
||||
123
common/.config/tmux/tmux.conf
Normal file
123
common/.config/tmux/tmux.conf
Normal file
@@ -0,0 +1,123 @@
|
||||
# Keybinding Summary
|
||||
#========================================================
|
||||
# Rename Session -> <alt-a> $
|
||||
# Rename Tab -> <alt-a> ,
|
||||
# Next/prev tab -> <alt-a> n/p
|
||||
# H-split/V-split -> <alt-a> s/v
|
||||
# Resize Pane -> <alt-a> leave alt -> h,j,k,l (repeat press)
|
||||
# Switch Pane -> <ctrl-h,j,k,l>
|
||||
# Enter copy mode -> <alt-a>[
|
||||
# Exit copy mode -> <enter>
|
||||
# Reload tmux.conf -> <alt-a> r
|
||||
|
||||
# More at: https://tmuxcheatsheet.com
|
||||
|
||||
# TODO: Figure out how to save multiple sessions and resurrect them later
|
||||
|
||||
#========================================================
|
||||
# KEY BINDINGS
|
||||
#========================================================
|
||||
# Change Tmux leader key to -> <alt-a>
|
||||
unbind C-b
|
||||
set -g prefix M-a
|
||||
bind-key M-a send-prefix
|
||||
|
||||
# Kill current session with q
|
||||
bind q confirm-before kill-session
|
||||
|
||||
# Intuitive split bindings to | & -
|
||||
unbind %
|
||||
bind s split-window -h
|
||||
unbind '"'
|
||||
bind v split-window -v
|
||||
|
||||
# Open panes in the current directory
|
||||
bind - split-window -v -c "#{pane_current_path}"
|
||||
bind | split-window -h -c "#{pane_current_path}"
|
||||
|
||||
# Use <leader> repeated(h,j,k,l)s to resize current pane
|
||||
bind -r h resize-pane -L
|
||||
bind -r l resize-pane -R
|
||||
bind -r k resize-pane -U
|
||||
bind -r j resize-pane -D
|
||||
|
||||
# Use Vim Navigations to copy text from the NON-vim panes
|
||||
# Enable Tmux copy mode with <leader>[ -> Then use Vim navigations
|
||||
bind-key -T copy-mode-vi "v" send -X begin-selection
|
||||
bind-key -T copy-mode-vi "y" send -X copy-selection
|
||||
unbind -T copy-mode-vi MouseDragEnd1Pane # Enable mouse selection as well
|
||||
|
||||
# From Tmux-sensible Plugin
|
||||
bind C-p previous-window
|
||||
bind C-n next-window
|
||||
bind C-a send-prefix
|
||||
bind a last-window
|
||||
bind r source-file ~/.config/tmux/tmux.conf \; display-message "Tmux config reloaded."
|
||||
|
||||
# Change resurrect keys to <alt-s>(Save) & <alt-r>(Resurrect)
|
||||
set -g @resurrect-save "M-s"
|
||||
set -g @resurrect-restore "M-r"
|
||||
|
||||
#========================================================
|
||||
# OPTIONS
|
||||
#========================================================
|
||||
set -g set-clipboard on # Use system clipboard
|
||||
setw -g mode-keys vi
|
||||
set-window-option -g mode-keys vi
|
||||
|
||||
# From tmux-sensible plugin
|
||||
set -g display-time 1000 # Display message for 1s
|
||||
set -g history-limit 50000 # Increase scrollback buffer
|
||||
set -g mouse on # Mouse mode
|
||||
set -s escape-time 0 # Address Vim switching delay
|
||||
set -g status-interval 5 # Refresh status every 5s (default 15s)
|
||||
set -g focus-events on # Enable focus event
|
||||
setw -g aggressive-resize on # For grouped sessions
|
||||
|
||||
# Resurrection Options
|
||||
set -g @resurrect-capture-pane-contents "on"
|
||||
set -g @resurrect-strategy-nvim "session"
|
||||
set -g @resurrect-dir "$HOME/.config/tmux/resurrect"
|
||||
|
||||
#========================================================
|
||||
# APPEARANCE
|
||||
#========================================================
|
||||
# Start window numbers at 1 to match keyboard order with tmux window order
|
||||
set -g base-index 1
|
||||
set -g pane-base-index 1
|
||||
set -g renumber-windows on
|
||||
set-window-option -g pane-base-index 1
|
||||
|
||||
# Improve colors
|
||||
set -g default-terminal "xterm-256color"
|
||||
set-option -sa terminal-overrides ",xterm*:Tc"
|
||||
|
||||
# Status at top
|
||||
set -g status-position top
|
||||
|
||||
#========================================================
|
||||
# PLUGINS
|
||||
#========================================================
|
||||
run "~/.config/tmux/plugins/tpm/tpm" # Init Tmux Plugin Manager
|
||||
|
||||
# TODO: Get into Tmux copy stuff when required
|
||||
# set -g @plugin 'tmux-plugins/tmux-yank'
|
||||
# set -g @plugin "tmux-plugins/tmux-copycat"
|
||||
|
||||
set -g @plugin "christoomey/vim-tmux-navigator" # sync pane nav with Vim window nav
|
||||
set -g @plugin "tmux-plugins/tmux-resurrect" # Persist sessions
|
||||
set -g @plugin "tmux-plugins/tmux-continuum" # Auto save sessions every 15mins
|
||||
set -g @plugin 'tmux-plugins/tmux-yank'
|
||||
set -g @plugin "tmux-plugins/tmux-copycat"
|
||||
set -g @plugin "fabioluciano/tmux-tokyo-night"
|
||||
|
||||
#========================================================
|
||||
# PLUGINS Configurations
|
||||
#========================================================
|
||||
|
||||
# Color schemes
|
||||
set -g @theme_variation "night"
|
||||
set -g @theme_disable_plugins 1
|
||||
set -g status-right ""
|
||||
|
||||
set -g @plugin "tmux-plugins/tpm"
|
||||
61
common/.config/wezterm/wezterm.lua
Normal file
61
common/.config/wezterm/wezterm.lua
Normal file
@@ -0,0 +1,61 @@
|
||||
local wezterm = require("wezterm")
|
||||
|
||||
return {
|
||||
color_scheme = "Catppuccin Mocha",
|
||||
font_size = 14.0,
|
||||
font = wezterm.font_with_fallback({
|
||||
-- "JetBrains Mono",
|
||||
"JetBrainsMono Nerd Font",
|
||||
{ family = "Symbols Nerd Font Mono", scale = 0.75 }
|
||||
}),
|
||||
window_decorations = "RESIZE",
|
||||
enable_tab_bar = true,
|
||||
use_fancy_tab_bar = true,
|
||||
hide_tab_bar_if_only_one_tab = true,
|
||||
-- window_background_opacity = 0.99,
|
||||
win32_system_backdrop = "Mica",
|
||||
macos_window_background_blur = 80,
|
||||
|
||||
window_padding = {
|
||||
left = 0,
|
||||
right = 0,
|
||||
top = 0,
|
||||
bottom = 0,
|
||||
},
|
||||
|
||||
keys = {
|
||||
{
|
||||
key = "f",
|
||||
mods = "ALT",
|
||||
action = wezterm.action.ToggleFullScreen,
|
||||
},
|
||||
},
|
||||
|
||||
mouse_bindings = {
|
||||
{
|
||||
event = { Up = { streak = 1, button = "Left" } },
|
||||
mods = "CTRL",
|
||||
action = wezterm.action.OpenLinkAtMouseCursor,
|
||||
}
|
||||
},
|
||||
|
||||
force_reverse_video_cursor = true,
|
||||
colors = {
|
||||
foreground = "#dcd7ba",
|
||||
background = "#1f1f28",
|
||||
|
||||
cursor_bg = "#c8c093",
|
||||
cursor_fg = "#c8c093",
|
||||
cursor_border = "#c8c093",
|
||||
|
||||
selection_fg = "#c8c093",
|
||||
selection_bg = "#2d4f67",
|
||||
|
||||
scrollbar_thumb = "#16161d",
|
||||
split = "#16161d",
|
||||
|
||||
ansi = { "#090618", "#c34043", "#76946a", "#c0a36e", "#7e9cd8", "#957fb8", "#6a9589", "#c8c093" },
|
||||
brights = { "#727169", "#e82424", "#98bb6c", "#e6c384", "#7fb4ca", "#938aa9", "#7aa89f", "#dcd7ba" },
|
||||
indexed = { [16] = "#ffa066", [17] = "#ff5d62" },
|
||||
},
|
||||
}
|
||||
50
common/.gitignore
vendored
50
common/.gitignore
vendored
@@ -1,3 +1,23 @@
|
||||
# ---- KDE Neon ----
|
||||
# KDE directory preferences
|
||||
.directory
|
||||
|
||||
# temporary files which can be created if a process still has a handle open of a deleted file
|
||||
.fuse_hidden*
|
||||
|
||||
# Linux trash folder which might appear on any partition or disk
|
||||
.Trash-*
|
||||
|
||||
# .nfs files are created when an open file is removed but is still being accessed
|
||||
.nfs*
|
||||
|
||||
# Binaries for programs and plugins
|
||||
*.exe
|
||||
*.exe~
|
||||
*.dll
|
||||
*.so
|
||||
*.dylib
|
||||
|
||||
# ---- macOS ----
|
||||
# General
|
||||
.DS_Store
|
||||
@@ -26,32 +46,14 @@ Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
|
||||
# ---- KDE Neon ----
|
||||
# KDE directory preferences
|
||||
.directory
|
||||
|
||||
# temporary files which can be created if a process still has a handle open of a deleted file
|
||||
.fuse_hidden*
|
||||
|
||||
# Linux trash folder which might appear on any partition or disk
|
||||
.Trash-*
|
||||
|
||||
# .nfs files are created when an open file is removed but is still being accessed
|
||||
.nfs*
|
||||
|
||||
# Binaries for programs and plugins
|
||||
*.exe
|
||||
*.exe~
|
||||
*.dll
|
||||
*.so
|
||||
*.dylib
|
||||
|
||||
# ---- IDE ----
|
||||
# Vim Artifacts
|
||||
*.swp
|
||||
**.swp
|
||||
lazy-lock.json
|
||||
.luarc.json
|
||||
|
||||
# VS Code Artifacts
|
||||
.vscode
|
||||
/.vscode/
|
||||
**state.vscdb
|
||||
**state.vscdb.backup
|
||||
.vscode/extensions/** # Ignore all Files under .vscode/extensions/
|
||||
@@ -62,10 +64,6 @@ Temporary Items
|
||||
*.imi
|
||||
*.jar
|
||||
*.tar
|
||||
|
||||
# Vim Artifacts
|
||||
*.swp
|
||||
|
||||
resharper-host/
|
||||
tasks/
|
||||
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
######################## Key Bindings ########################
|
||||
# Change prefix to -> (Ctrl + a)
|
||||
set-option -g prefix C-a
|
||||
unbind-key C-a
|
||||
bind-key C-a send-prefix
|
||||
|
||||
# Use Shift-arrow keys to switch panes
|
||||
bind -n S-Left select-pane -L
|
||||
bind -n S-Right select-pane -R
|
||||
bind -n S-Up select-pane -U
|
||||
bind -n S-Down select-pane -D
|
||||
|
||||
# Alt arrow to switch windows
|
||||
bind -n M-Left previous-window
|
||||
bind -n M-Right next-window
|
||||
|
||||
# Set easier window split keys
|
||||
bind-key v split-window -h
|
||||
bind-key h split-window -v
|
||||
|
||||
# Easy config reload
|
||||
bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded."
|
||||
######################## Key Bindings ########################
|
||||
|
||||
|
||||
|
||||
######################## Windows ########################
|
||||
# Start window numbers at 1 to match keyboard order with tmux window order
|
||||
set -g base-index 1
|
||||
set-window-option -g pane-base-index 1
|
||||
|
||||
# Renumber windows sequentially after closing any of them
|
||||
set -g renumber-windows on
|
||||
######################## Windows ########################
|
||||
|
||||
|
||||
|
||||
######################## Colors ########################
|
||||
# improve colors
|
||||
set -g default-terminal 'screen-256color'
|
||||
|
||||
# Soften status bar color from harsh green to light gray
|
||||
set -g status-style bg='#666666',fg='#aaaaaa'
|
||||
|
||||
######################## Colors ########################
|
||||
|
||||
|
||||
|
||||
######################## Other Features ########################
|
||||
# Increase scrollback lines
|
||||
set -g history-limit 10000
|
||||
|
||||
# Mouse mode
|
||||
setw -g mouse on
|
||||
|
||||
# Restore tmux-sessions -> https://github.com/tmux-plugins/tmux-resurrect
|
||||
run-shell ~/downloads/softwares/tmux-resurrect/resurrect.tmux ######################## Other Features ########################
|
||||
@@ -2,39 +2,62 @@
|
||||
filetype plugin indent on
|
||||
set omnifunc=syntaxcomplete#Complete
|
||||
set complete+=kspell
|
||||
set complete-=i
|
||||
set completeopt="menuone,noselect"
|
||||
|
||||
" Make sure tabs are 4 character wide
|
||||
set shiftwidth=4 tabstop=4 softtabstop=4 expandtab
|
||||
set autoindent smartindent
|
||||
set shiftwidth=4 tabstop=4 softtabstop=4 expandtab smarttab
|
||||
set autoindent smartindent breakindent
|
||||
|
||||
syntax on " syntax highlighting.
|
||||
syntax enable
|
||||
set cursorline " Hightlight cursor line
|
||||
set showmatch " Highlight matching braces
|
||||
set ls=2 " Show a status line
|
||||
set wrap " Wrap text
|
||||
set wildmenu " Makes the ex command mode autocomplete paths with Tab
|
||||
set number " Show line numbers
|
||||
set ruler
|
||||
set relativenumber " Relative line numbers
|
||||
set shortmess+=I " Disable the default Vim startup message.
|
||||
set noerrorbells visualbell t_vb= " Disable audible bell because it's annoying.
|
||||
set mouse+=a " Enable mouse support
|
||||
set encoding=utf-8 " Encoding
|
||||
set autoread
|
||||
set nrformats-=octal
|
||||
set formatoptions+=j
|
||||
set display+=lastline
|
||||
set display+=truncate
|
||||
set history=1000
|
||||
set tabpagemax=50
|
||||
set viminfo^=!
|
||||
set sessionoptions-=options
|
||||
set viewoptions-=options
|
||||
set nolangremap
|
||||
set list
|
||||
set signcolumn=yes
|
||||
set scrolloff=5
|
||||
set isfname+={,},@-@
|
||||
set updatetime=50
|
||||
|
||||
" Enable undofile and save them in ~/.vim/undo
|
||||
set undofile " Enable undofiles
|
||||
set undodir=$HOME/.vim/undo// " Save in each project's root
|
||||
set directory^=$HOME/.vim/swap// " All swap files at the one place please
|
||||
|
||||
" Vim, by default, won't let you jump to a different file without saving the
|
||||
" current one. With the below, unsaved files are just hidden.
|
||||
set hidden
|
||||
|
||||
" Enable searching as you type, rather than waiting till you press enter.
|
||||
" Highlight search pattern
|
||||
" Intelligently handle cases in search
|
||||
" Enable searching as you type, rather than waiting till you press enter. Highlight search pattern. Intelligently handle cases in search.
|
||||
set incsearch hlsearch ignorecase smartcase
|
||||
|
||||
" Comments in Grey color and italic
|
||||
hi Comment guifg=#5C6370 ctermfg=50 cterm=italic
|
||||
|
||||
" Highlight and remove trailing blank spaces on save
|
||||
highlight ExtraWhitespace ctermbg=red guibg=red
|
||||
match ExtraWhitespace /\s\+$/
|
||||
highlight ExtraWhitespace ctermbg=red guibg=red
|
||||
autocmd BufWritePre * %s/\s\+$//e
|
||||
|
||||
" Vim is based on Vi. Setting `nocompatible` switches from the default
|
||||
@@ -49,8 +72,7 @@ set nocompatible
|
||||
" Normally, backspace works only if you have made an edit. This fixes that.
|
||||
set backspace=indent,eol,start
|
||||
|
||||
" Sync vim clipboard with system clipboard
|
||||
" Works across Linux, MacOS & Windows
|
||||
" Sync vim clipboard with system clipboard. Works across Linux, MacOS & Windows.
|
||||
if has("mac")
|
||||
set clipboard+=unnamed
|
||||
else
|
||||
@@ -62,5 +84,6 @@ if !has('gui_running')
|
||||
set t_Co=256
|
||||
set termguicolors
|
||||
hi LineNr ctermbg=NONE guibg=NONE
|
||||
set termguicolors
|
||||
endif
|
||||
|
||||
|
||||
@@ -13,6 +13,14 @@ inoremap <Down> <ESC>:echoe "Use j"<CR>
|
||||
" Unbind some useless/annoying default key bindings.
|
||||
nmap Q <Nop>
|
||||
|
||||
" Don't do anything on pressing space itself
|
||||
nnoremap <Space> <Nop>
|
||||
vnoremap <Space> <Nop>
|
||||
|
||||
" Make space-bar the leader-key
|
||||
let mapleader = " "
|
||||
let maplocalleader = " "
|
||||
|
||||
" Center the cursor when moving through document
|
||||
nnoremap <C-d> <C-d>zz
|
||||
nnoremap <C-u> <C-u>zz
|
||||
@@ -24,6 +32,14 @@ nnoremap ]s ]szz
|
||||
nnoremap n nzzzv
|
||||
nnoremap N Nzzzv
|
||||
|
||||
" Move visually selected lines around with J & K
|
||||
vnoremap J :m '>+1<CR>gv=gv
|
||||
vnoremap K :m '<-2<CR>gv=gv
|
||||
|
||||
" Keeps the cursor at the same place when doing J
|
||||
" And not move to end of the line
|
||||
nnoremap J mzJ`z:delmarks z<CR>
|
||||
|
||||
" Better window/split navigation
|
||||
map <C-j> <C-w>j
|
||||
map <C-k> <C-w>k
|
||||
@@ -31,10 +47,7 @@ map <C-h> <C-w>h
|
||||
map <C-l> <C-w>l
|
||||
|
||||
" Clear searches
|
||||
nnoremap <Leader>/ :call clearmatches()<CR>:noh<CR>
|
||||
|
||||
" Make space-bar the leader-key
|
||||
let mapleader = " "
|
||||
nnoremap <leader>/ :call clearmatches()<CR>:noh<CR>
|
||||
|
||||
" Changes the pwd to the opened file's directory
|
||||
nnoremap <leader>cd :lcd %:h<CR>
|
||||
@@ -44,7 +57,10 @@ map <leader>j <Plug>(easymotion-s)
|
||||
|
||||
" Map nerdtree to <Leader>e
|
||||
" Changes the pwd and opens the VCS root
|
||||
nnoremap <leader>e :lcd %:h<CR> :NERDTreeToggleVCS<CR>
|
||||
nnoremap <leader>e :tcd %:h<CR> :NERDTreeToggleVCS<CR>
|
||||
let g:NERDTreeShowHidden = 1
|
||||
let g:NERDTreeWinSize = 20
|
||||
let g:NERDTreeWinSize = 25
|
||||
|
||||
" <ctrl-q> to save everything and quit Neovim
|
||||
nnoremap <C-q> :wqa<CR>
|
||||
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
""""""""""""""""""""""""""""""""
|
||||
"
|
||||
" Plugins
|
||||
"
|
||||
"""""""""""""""""""""""""""""""""
|
||||
" This being the 1st line in the config file,
|
||||
" makes it possible to configure plugins any place in the file.
|
||||
call plug#begin('~/.vim/plugged')
|
||||
Plug 'tpope/vim-fugitive' "Fugitive Vim GitHub Wrapper
|
||||
Plug 'tpope/vim-surround' "Surround Plugin
|
||||
@@ -18,6 +11,8 @@ call plug#begin('~/.vim/plugged')
|
||||
Plug 'junegunn/rainbow_parentheses.vim' "Rainbow parenthesis
|
||||
Plug 'easymotion/vim-easymotion' "Easy Motion to quickly jump across the buffer
|
||||
Plug 'preservim/nerdtree' "Nerd Tree
|
||||
Plug 'tpope/vim-obsession' "Obsessions -> saves sessions
|
||||
Plug 'christoomey/vim-tmux-navigator' "Syncs with Tmux pane navigation keymaps
|
||||
"------------Style Plugins------------"
|
||||
" Status Styles
|
||||
Plug 'itchyny/lightline.vim'
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
Bhubaneswar
|
||||
Kolkata
|
||||
Holi
|
||||
Rakhi
|
||||
Subrat
|
||||
Ghosh
|
||||
Tussar
|
||||
Patra
|
||||
Ctrl
|
||||
Binary file not shown.
@@ -15,22 +15,15 @@ let g:session_dir="$VIMDIR/session"
|
||||
|
||||
""""""""""""""""""""""""""""""""
|
||||
"
|
||||
" LOOKS
|
||||
" THEME
|
||||
"
|
||||
""""""""""""""""""""""""""""""""
|
||||
let g:lightline = { 'colorscheme': 'deepspace' }
|
||||
colorscheme deep-space
|
||||
|
||||
" Set color
|
||||
if !has('gui_running')
|
||||
set t_Co=256
|
||||
set termguicolors
|
||||
hi LineNr ctermbg=NONE guibg=NONE
|
||||
endif
|
||||
|
||||
""""""""""""""""""""""""""""""""
|
||||
"
|
||||
" Quality of life improvements
|
||||
" VIM SPECIFIC CONFIG
|
||||
"
|
||||
""""""""""""""""""""""""""""""""
|
||||
|
||||
|
||||
@@ -113,8 +113,8 @@ PATH=$(pyenv root)/shims:$PATH
|
||||
|
||||
# Aliases
|
||||
[[ ! -f ~/.aliases ]] || source ~/.aliases
|
||||
[[ ! -f ~/.mac_aliases ]] || source ~/.mac_aliases
|
||||
[[ ! -f ~/.neon_aliases ]] || source ~/.neon_aliases
|
||||
[[ ! -f ~/.aliases_mac ]] || source ~/.aliases_mac
|
||||
[[ ! -f ~/.aliases_neon ]] || source ~/.aliases_neon
|
||||
[[ ! -f ~/.aliases_personal ]] || source ~/.aliases_personal
|
||||
|
||||
# nvm Setup
|
||||
|
||||
@@ -15,3 +15,4 @@ dir_size(){
|
||||
|
||||
# Update & Upgrades
|
||||
alias up="brew upgrade --cask && brew upgrade --formula && rustup update && npm update -g"
|
||||
|
||||
Reference in New Issue
Block a user