mirror of
https://github.com/pratiktri/dotfiles.git
synced 2026-02-04 08:41:43 +05:30
- TMUX: Switched back to ctrl+b as leader
- VIM: Configurations better commented - NVIM: NVChad, LazyNvim, Old-Config removed - NVIM: Restarted and reconfigured from kickstart.nvim [WIP] - Dotfiles on $HOME removed from 160+ to 25. Most of them moved to $XDG_* directories - Shell: Added back p10k config - Shell: Autoremove brew left over applications - Kitty: Added bashrc & profiles for ssh kitten - Kitty: Custom tab-titles
This commit is contained in:
@@ -20,4 +20,3 @@ Example: bash ./bootstrap.sh -q --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 -->
|
||||
|
||||
@@ -93,9 +93,7 @@ if ! shopt -oq posix; then
|
||||
fi
|
||||
|
||||
################################################################################
|
||||
################################################################################
|
||||
############### Everything below this line are customizations
|
||||
################################################################################
|
||||
############### Everything below this line are customizations ##################
|
||||
################################################################################
|
||||
|
||||
# Do not let globbing complain on no match
|
||||
@@ -182,3 +180,8 @@ HISTFILE="$XDG_STATE_HOME/shell/bash_history"
|
||||
if command -v zoxide >/dev/null; then
|
||||
eval "$(zoxide init bash)"
|
||||
fi
|
||||
|
||||
# [ctrl+r]:replaces shell command search
|
||||
# [ctrl+t]:fzf & over the files & directories under the current one & paste it to prompt
|
||||
# [alt+c] :fzf & cd into a directory under the current one
|
||||
[ -f $XDG_STATE_HOME/shell/fzf.bash ] && source $XDG_STATE_HOME/shell/fzf.bash
|
||||
|
||||
176
common/.config/kitty/.bashrc
Normal file
176
common/.config/kitty/.bashrc
Normal file
@@ -0,0 +1,176 @@
|
||||
# ~/.bashrc: executed by bash(1) for non-login shells.
|
||||
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
|
||||
# for examples
|
||||
|
||||
# If not running interactively, don't do anything
|
||||
case $- in
|
||||
*i*) ;;
|
||||
*) return ;;
|
||||
esac
|
||||
|
||||
# append to the history file, don't overwrite it
|
||||
shopt -s histappend
|
||||
|
||||
# check the window size after each command and, if necessary,
|
||||
# update the values of LINES and COLUMNS.
|
||||
shopt -s checkwinsize
|
||||
|
||||
# If set, the pattern "**" used in a pathname expansion context will
|
||||
# match all files and zero or more directories and subdirectories.
|
||||
#shopt -s globstar
|
||||
|
||||
# make less more friendly for non-text input files, see lesspipe(1)
|
||||
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
|
||||
|
||||
# set variable identifying the chroot you work in (used in the prompt below)
|
||||
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
|
||||
debian_chroot=$(cat /etc/debian_chroot)
|
||||
fi
|
||||
|
||||
# set a fancy prompt (non-color, unless we know we "want" color)
|
||||
case "$TERM" in
|
||||
xterm-color | *-256color) color_prompt=yes ;;
|
||||
esac
|
||||
|
||||
# uncomment for a colored prompt, if the terminal has the capability; turned
|
||||
# off by default to not distract the user: the focus in a terminal window
|
||||
# should be on the output of commands, not on the prompt
|
||||
#force_color_prompt=yes
|
||||
|
||||
if [ -n "$force_color_prompt" ]; then
|
||||
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
|
||||
# We have color support; assume it's compliant with Ecma-48
|
||||
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
|
||||
# a case would tend to support setf rather than setaf.)
|
||||
color_prompt=yes
|
||||
else
|
||||
color_prompt=
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$color_prompt" != yes ]; then
|
||||
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
|
||||
fi
|
||||
|
||||
unset color_prompt force_color_prompt
|
||||
|
||||
# If this is an xterm set the title to user@host:dir
|
||||
case "$TERM" in
|
||||
xterm* | rxvt*)
|
||||
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
|
||||
;;
|
||||
*) ;;
|
||||
esac
|
||||
|
||||
# enable color support of ls and also add handy aliases
|
||||
if [ -x /usr/bin/dircolors ]; then
|
||||
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
||||
alias ls='ls --color=auto'
|
||||
#alias dir='dir --color=auto'
|
||||
#alias vdir='vdir --color=auto'
|
||||
|
||||
alias grep='grep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
alias egrep='egrep --color=auto'
|
||||
fi
|
||||
|
||||
# colored GCC warnings and errors
|
||||
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
|
||||
|
||||
# Add an "alert" alias for long running commands. Use like so:
|
||||
# sleep 10; alert
|
||||
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
|
||||
|
||||
# enable programmable completion features (you don't need to enable
|
||||
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
|
||||
# sources /etc/bash.bashrc).
|
||||
if ! shopt -oq posix; then
|
||||
if [ -f /usr/share/bash-completion/bash_completion ]; then
|
||||
. /usr/share/bash-completion/bash_completion
|
||||
elif [ -f /etc/bash_completion ]; then
|
||||
. /etc/bash_completion
|
||||
fi
|
||||
fi
|
||||
|
||||
################################################################################
|
||||
############### Everything below this line are customizations ##################
|
||||
################################################################################
|
||||
|
||||
# Do not let globbing complain on no match
|
||||
shopt -s nullglob
|
||||
|
||||
## When only a directory is entered without cd, cd into it
|
||||
shopt -s autocd
|
||||
|
||||
function timer_start {
|
||||
timer=${timer:-$SECONDS}
|
||||
}
|
||||
|
||||
trap 'timer_start' DEBUG
|
||||
|
||||
PROMPT_COMMAND=jazz_my_prompt
|
||||
|
||||
jazz_my_prompt() {
|
||||
# Capture exit code of last command
|
||||
# Below MUST be the 1st line of the function
|
||||
local ex=$?
|
||||
|
||||
# Capture the last command's execution time
|
||||
timer_show=$(($SECONDS - $timer))
|
||||
unset timer
|
||||
|
||||
#----------------------------------------------------------------------------#
|
||||
# Bash text colour specification: \e[<COLOUR>;<STYLE>m
|
||||
# Colours: 31=red, 32=green, 33=yellow, 34=blue, 35=purple, 36=cyan, 37=white
|
||||
# Styles: 0=normal, 1=bold, 2=dimmed, 4=underlined, 7=highlighted
|
||||
#----------------------------------------------------------------------------#
|
||||
|
||||
local reset="\[\e[0m\]"
|
||||
local normal=';0m'
|
||||
local bold=';1m'
|
||||
local boldyellow="\[\e[32${bold}\]"
|
||||
local boldwhite="\[\e[37${bold}\]"
|
||||
local normalwhite="\[\e[37${normal}\]"
|
||||
local yellow_highlight="\[\e[31;7m\]"
|
||||
|
||||
# Add color preference BEFORE the item
|
||||
local hostname="${normalwhite}\h"
|
||||
local username="${boldwhite}\u"
|
||||
local jobs="${boldwhite}jobs:\j"
|
||||
local history_cnt="${normalwhite}!\!"
|
||||
local timestamp="${normalwhite}\D{%H:%M:%S(%z) %d%b}"
|
||||
local session_cmd_cnt="${normalwhite}#\#"
|
||||
local pwd="${boldwhite}\w"
|
||||
local isroot="${boldwhite}\$"
|
||||
|
||||
# Set prompt content
|
||||
# If exit code of last command is non-zero, prepend this code to the prompt
|
||||
local exit_code=''
|
||||
if [[ "$ex" -eq 0 ]]; then
|
||||
exit_code="${boldwhite}✓"
|
||||
else
|
||||
exit_code="${yellow_highlight}✗ $ex\a${reset}"
|
||||
fi
|
||||
|
||||
# Style each group separately
|
||||
local groupstart="${boldyellow}["
|
||||
local groupend="${boldyellow}]"
|
||||
group1="${groupstart}${username}@${hostname}${groupend}"
|
||||
group2="${groupstart}${jobs}${groupend}"
|
||||
group3="${groupstart}${history_cnt}${groupend}"
|
||||
group4="${groupstart}${session_cmd_cnt}${groupend}"
|
||||
group5="${groupstart}${timestamp}${groupend}"
|
||||
group6="${groupstart}${exit_code}${groupend}"
|
||||
group8="${groupstart}${pwd}${groupend}"
|
||||
group9="${groupstart}${normalwhite}${timer_show}s${groupend}"
|
||||
|
||||
# Position each group where you would like them
|
||||
PS1="\n${group1}-${group2}-${group3}-${group4}-${group5}\n${group6}-${group9}-${group8}\n${isroot}${reset} "
|
||||
}
|
||||
|
||||
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
|
||||
HISTSIZE=-1
|
||||
HISTFILESIZE=-1
|
||||
HISTCONTROL=ignorespace
|
||||
HISTTIMEFORMAT="%H:%M:%S(%z)%d-%b-%y "
|
||||
HISTFILE="$XDG_STATE_HOME/shell/bash_history"
|
||||
39
common/.config/kitty/.profile
Normal file
39
common/.config/kitty/.profile
Normal file
@@ -0,0 +1,39 @@
|
||||
# set PATH so it includes user's private bin if it exists
|
||||
[ ! -d "$HOME/bin" ] || PATH="$HOME/bin:$PATH"
|
||||
|
||||
# set PATH so it includes user's private bin if it exists
|
||||
[ ! -d "$HOME/.local/bin" ] || PATH="$HOME/.local/bin:$PATH"
|
||||
|
||||
# Set the config directory enviroment variable
|
||||
[ ! -z "$XDG_CONFIG_HOME" ] || export XDG_CONFIG_HOME="$HOME/.config"
|
||||
|
||||
# Set the cache directory enviroment variable
|
||||
[ ! -z "$XDG_CACHE_HOME" ] || export XDG_CACHE_HOME="$HOME/.cache"
|
||||
|
||||
# Set the data directory enviroment variable
|
||||
[ ! -z "$XDG_DATA_HOME" ] || export XDG_DATA_HOME="$HOME/.local/share"
|
||||
|
||||
# Set the state directory enviroment variable
|
||||
[ ! -z "$XDG_STATE_HOME" ] || export XDG_STATE_HOME="$HOME/.local/state"
|
||||
|
||||
##################################################################################
|
||||
|
||||
EDITOR=$(command -v nvim 2>/dev/null || command -v vim 2>/dev/null)
|
||||
VISUAL=$EDITOR
|
||||
|
||||
# Manually follow steps from https://steamcommunity.com/app/646570/discussions/1/3935537639868400686
|
||||
# To disable ~/.oracle_jre_usage/ from being created
|
||||
|
||||
# Source aliases
|
||||
[ ! -f "$XDG_CONFIG_HOME/shell/aliases" ] || source "$XDG_CONFIG_HOME/shell/aliases"
|
||||
[ ! -f "$XDG_CONFIG_HOME/shell/aliases_personal" ] || source "$XDG_CONFIG_HOME/shell/aliases_personal"
|
||||
|
||||
export GNUPGHOME="$XDG_CONFIG_HOME/gnupg"
|
||||
export LESSHISTFILE="$XDG_STATE_HOME/shell/lesshst"
|
||||
export WGET_HSTS_FILE="$XDG_STATE_HOME/shell/wget-hsts-history" # wget aliased to use this path
|
||||
|
||||
# Setup Python
|
||||
export PYENV_ROOT="$XDG_DATA_HOME/pyenv"
|
||||
command -v pyenv >/dev/null && export PATH="$PATH:$PYENV_ROOT/bin"
|
||||
command -v pyenv >/dev/null && eval "$(pyenv init -)"
|
||||
export PYTHON_HISTORY="$XDG_STATE_HOME/shell/python_history" # will be picked up by Python 3.13+
|
||||
@@ -251,7 +251,6 @@
|
||||
font_family JetBrains Mono Nerd Font
|
||||
font_size 14
|
||||
bold_font auto
|
||||
static_font auto
|
||||
bold_italic_font auto
|
||||
disable_ligatures never
|
||||
|
||||
@@ -425,7 +424,6 @@ cursor_beam_thickness 1
|
||||
|
||||
scrollback_lines 10000
|
||||
scrollback_pager_history_size 10
|
||||
# scrollback_pager less --chop-long-lines --RAW-CONTROL-CHARS +INPUT_LINE_NUMBER
|
||||
scrollback_pager nvim -c 'set ft=man'
|
||||
|
||||
#: Mouse {{{
|
||||
@@ -1186,6 +1184,8 @@ map ctrl+shift+o launch --cwd=current --type=tab nvim
|
||||
|
||||
#: }}}
|
||||
|
||||
tab_title_template "{sup.index}{fmt.fg.red}{bell_symbol}{activity_symbol}{fmt.fg.tab}{title[title.rfind('/')+1:]} : {tab.active_exe}"
|
||||
|
||||
#: Color scheme {{{
|
||||
|
||||
# foreground #dddddd
|
||||
@@ -1654,7 +1654,6 @@ background_blur 65
|
||||
|
||||
#: }}}
|
||||
|
||||
editor nvim
|
||||
update_check_interval 0
|
||||
|
||||
# Enable kitty scrollback.nvim plugin
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
{
|
||||
"neodev": {
|
||||
"library": {
|
||||
"enabled": true,
|
||||
"plugins": true
|
||||
}
|
||||
},
|
||||
"neoconf": {
|
||||
"plugins": {
|
||||
"lua_ls": {
|
||||
"enabled": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
column_width = 160
|
||||
line_endings = "Unix"
|
||||
indent_type = "Spaces"
|
||||
indent_width = 4
|
||||
column_width = 120
|
||||
quote_style = "AutoPreferDouble"
|
||||
@@ -1,68 +1,60 @@
|
||||
-- General Usage and debugging Nvim hints ---------------------------
|
||||
-- Use `vim.print()` to printout some variable
|
||||
-- TIP: General Usage and debugging Nvim hints:
|
||||
-- Use `vim.print()` to printout variables
|
||||
-- :lua > `require("plugin-name")` to load a plugin manually
|
||||
-- To check all issues in plugins -> :checkhealth
|
||||
-- To remove a keymaps -> `vim.keymap.del("n", "<leader>someth")`
|
||||
-- To override plugin's keymap -> inside "/lua/plugins" create a file > refer to the plugin > change whatever you want in the plugins. cmd, event, ft, keys, opts, dependencies properties are merged. All other properties are overridden. But if any property takes a function -> it'll always be overridden.
|
||||
-- To remove/disable a plugin - in the above step add `enabled = false` property.
|
||||
-- Show diff: 2 splits with the files -> :windo diffthis. To exit -> :windo diffoff
|
||||
-- To check all the keymaps -> :Telescope keymaps
|
||||
-- Check all notifications -> :Notifications
|
||||
-- Check past messages -> :messages
|
||||
|
||||
-- NOTE: To check all the keymaps -> :Telescope keymaps
|
||||
-- NOTE: Check all notifications -> :Notifications
|
||||
-- TIP: Keymap structure:
|
||||
-- b: buffer
|
||||
-- g: git/github
|
||||
-- c: Coding things
|
||||
-- e: explorer
|
||||
-- f: list & find something
|
||||
-- s: Grep/Search over something
|
||||
-- x: close/dismiss something
|
||||
-- r: restore sessions
|
||||
-- l: List some stuff
|
||||
|
||||
-- NOTE: For autoformatting language:
|
||||
-- 1. Add to :Mason ensure_installed,
|
||||
-- 2. Add to null-ls sources,
|
||||
-- 3. Add to conform's formatter_by_ft list.
|
||||
-- Load keymaps & options
|
||||
require("config")
|
||||
|
||||
-- NOTE: For supporting a language LSP:
|
||||
-- 1. Add to treesitter ensure_installed,
|
||||
-- 2. Add to :Mason ensure_installed,
|
||||
-- 3. Add to none-ls sources,
|
||||
-- 4. Add to nvim-lint's linters_by_ft list,
|
||||
-- 5. Add to nvim-lspconfig's servers
|
||||
-- `:help lazy.nvim.txt` for more info
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable",
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
---------------------------------------------------------------------
|
||||
---------------------------TODO Items--------------------------------
|
||||
---------------------------------------------------------------------
|
||||
-- Editor
|
||||
-- TODO: Telescope: search hidden folders (except .git/.idea/.vscode/node_modules etc.)
|
||||
-- TODO: Telescope: Map opening selected file in different splits/tabs
|
||||
-- FIXIT: nvim-lsp: Reduce LSP update progress messages-> opts.lsp.progress{}
|
||||
-- FIXIT: Disable which-key prompts for 'd' - way too much distraction
|
||||
-- FIXIT: Remove padding from bottom (below lualine) & right border
|
||||
|
||||
-- Coding General
|
||||
-- FIXIT: LSP suggestions hides the line being edited
|
||||
-- Keymap to close LSP hints?
|
||||
-- FIXIT: ys commands do not work - some paste thing is overriding it
|
||||
|
||||
-- FIXIT: SymbolsOutline doesn't work sometimes
|
||||
-- TODO: Which file installs mason?
|
||||
-- TODO: Configure following:
|
||||
-- 1. coding-json.lua,
|
||||
-- 2. coding-markdown.lua,
|
||||
-- 4. coding-python.lua (+black),
|
||||
-- 5. coding-rust.lua
|
||||
-- TODO: Have inline hints - rust-tools + https://github.com/simrat39/inlay-hints.nvim
|
||||
-- Test autocomplete on Rust projects
|
||||
-- 6. coding-tailwind.lua,
|
||||
-- 7. coding-typescript.lua (+eslint+prettier),
|
||||
-- TODO: Typescript - LSP integration - not being attached right now
|
||||
-- Test autocomplete on Typescript projects
|
||||
-- 8. coding-yaml.lua,
|
||||
-- 9. coding-docker.lua
|
||||
-- TODO: null-ls + dap + nlua + neotest in coding.lua
|
||||
|
||||
-- Coding Rust
|
||||
-- TODO: Rust debugging
|
||||
|
||||
-- General
|
||||
-- TODO: Create Ulauncher plugin for reading/searching/quickaccess saved sessions
|
||||
-- This needs to open the session in desired terminal app
|
||||
-- TODO: fzf scipt to show pop-up of all saved sessions on nvim <tab>
|
||||
|
||||
-- TODO: Figure out how to quickly stop all code suggestions & completions
|
||||
|
||||
-- bootstrap lazy.nvim, LazyVim and your plugins
|
||||
require("config.lazy")
|
||||
-- You can also configure plugins after the setup call,
|
||||
-- as they will be available in your neovim runtime.
|
||||
require("lazy").setup({
|
||||
{ import = "plugins" },
|
||||
}, {
|
||||
lockfile = vim.fn.stdpath("data") .. "/lazy/lazy-lock.json",
|
||||
change_detection = {
|
||||
notify = false,
|
||||
},
|
||||
performance = {
|
||||
rtp = {
|
||||
-- Disable some rtp plugins
|
||||
disabled_plugins = {
|
||||
"gzip",
|
||||
"matchit",
|
||||
-- "matchparen",
|
||||
"netrwPlugin",
|
||||
"tarPlugin",
|
||||
"tutor",
|
||||
"zipPlugin",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"extras": [
|
||||
"lazyvim.plugins.extras.dap.core",
|
||||
"lazyvim.plugins.extras.dap.nlua",
|
||||
"lazyvim.plugins.extras.editor.navic",
|
||||
"lazyvim.plugins.extras.editor.symbols-outline",
|
||||
"lazyvim.plugins.extras.formatting.black",
|
||||
"lazyvim.plugins.extras.formatting.prettier",
|
||||
"lazyvim.plugins.extras.lang.docker",
|
||||
"lazyvim.plugins.extras.lang.markdown",
|
||||
"lazyvim.plugins.extras.lang.omnisharp",
|
||||
"lazyvim.plugins.extras.lang.python",
|
||||
"lazyvim.plugins.extras.lang.rust",
|
||||
"lazyvim.plugins.extras.lang.yaml",
|
||||
"lazyvim.plugins.extras.linting.eslint",
|
||||
"lazyvim.plugins.extras.lsp.none-ls",
|
||||
"lazyvim.plugins.extras.test.core"
|
||||
],
|
||||
"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
|
||||
2
common/.config/nvim/lua/config/init.lua
Normal file
2
common/.config/nvim/lua/config/init.lua
Normal file
@@ -0,0 +1,2 @@
|
||||
require("config.keymaps")
|
||||
require("config.options")
|
||||
@@ -1,47 +1,13 @@
|
||||
-- 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
|
||||
|
||||
-- Load Keybindings from VIM
|
||||
local vim_mappings = os.getenv("HOME") .. "/.vim/key_maps.vim"
|
||||
if vim.loop.fs_stat(vim_mappings) then
|
||||
vim.cmd("source " .. vim_mappings)
|
||||
end
|
||||
|
||||
-- Delete Lazyvim.keymap that I don't like
|
||||
vim.keymap.del("n", "<S-h>")
|
||||
vim.keymap.del("n", "<S-l>")
|
||||
vim.keymap.del("n", "[b")
|
||||
vim.keymap.del("n", "]b")
|
||||
vim.keymap.del("n", "<leader>bb")
|
||||
vim.keymap.del("n", "<leader>,")
|
||||
vim.keymap.del("n", "<leader>`")
|
||||
vim.keymap.del("n", "<leader>qq")
|
||||
vim.keymap.del("n", "<leader>cd")
|
||||
vim.keymap.del("n", "<leader>l")
|
||||
vim.keymap.del("i", ",")
|
||||
vim.keymap.del("i", ".")
|
||||
vim.keymap.del("i", ";")
|
||||
vim.keymap.del("n", "<leader>ur")
|
||||
vim.keymap.del("n", "<leader>ww")
|
||||
vim.keymap.del("n", "<leader>wd")
|
||||
vim.keymap.del("n", "<leader>w-")
|
||||
vim.keymap.del("n", "<leader>w|")
|
||||
vim.keymap.del("n", "<leader>-")
|
||||
vim.keymap.del("n", "<leader>|")
|
||||
vim.keymap.del("n", "<leader><tab>l")
|
||||
vim.keymap.del("n", "<leader><tab>f")
|
||||
vim.keymap.del("n", "<leader><tab><tab>")
|
||||
vim.keymap.del("n", "<leader><tab>]")
|
||||
vim.keymap.del("n", "<leader><tab>d")
|
||||
vim.keymap.del("n", "<leader><tab>[")
|
||||
|
||||
vim.keymap.set({ "n" }, "<C-c>", "<cmd> %y+ <CR>", { desc = "Copy entire content of the current buffer" })
|
||||
vim.keymap.set("n", "<leader>fn", "<cmd>enew<CR>", { desc = "Create new file/buffer" })
|
||||
|
||||
-- Following are copied from LazyVim - will use them elsewhere as well
|
||||
-----------------------------------------------------------------------
|
||||
-- Better up/down
|
||||
-- Remap for dealing with word wrap
|
||||
vim.keymap.set({ "n", "x" }, "j", "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
|
||||
vim.keymap.set({ "n", "x" }, "k", "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
|
||||
|
||||
@@ -71,12 +37,22 @@ vim.keymap.set("n", "<S-Tab>", "<cmd>bprevious<CR>", { desc = "Switch to previou
|
||||
vim.keymap.set({ "i", "x", "n", "s" }, "<C-s>", "<cmd>w<cr><esc>", { desc = "Save file" })
|
||||
vim.keymap.set({ "i", "x", "n", "s" }, "<C-q>", "<cmd>wqa<cr><esc>", { desc = "Save all files and Quit Neovim" })
|
||||
|
||||
-- Close Current Buffer
|
||||
vim.keymap.set({ "n", "v" }, "<leader>bx", function()
|
||||
if vim.bo.modified then
|
||||
vim.cmd.write()
|
||||
end
|
||||
vim.cmd("bdelete")
|
||||
end, { desc = "Save and close current buffer" })
|
||||
|
||||
-- Traverse quickfix
|
||||
vim.keymap.set("n", "[q", vim.cmd.cprev, { desc = "Previous quickfix" })
|
||||
vim.keymap.set("n", "]q", vim.cmd.cnext, { desc = "Next quickfix" })
|
||||
|
||||
-- Clear search with <esc>
|
||||
-- Clear searches
|
||||
vim.keymap.set({ "i", "n" }, "<esc>", "<cmd>noh<cr><esc>", { desc = "Escape and clear hlsearch" })
|
||||
vim.keymap.set("n", "<leader>/", "<Cmd>nohlsearch<Bar>diffupdate<Bar>normal! <C-L><CR>",
|
||||
{ desc = "Redraw / clear hlsearch / diff update" })
|
||||
|
||||
vim.keymap.set("n", "n", "'Nn'[v:searchforward].'zv'", { expr = true, desc = "Next search result" })
|
||||
vim.keymap.set("x", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next search result" })
|
||||
@@ -84,49 +60,3 @@ vim.keymap.set("o", "n", "'Nn'[v:searchforward]", { expr = true, desc = "Next se
|
||||
vim.keymap.set("n", "N", "'nN'[v:searchforward].'zv'", { expr = true, desc = "Prev search result" })
|
||||
vim.keymap.set("x", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" })
|
||||
vim.keymap.set("o", "N", "'nN'[v:searchforward]", { expr = true, desc = "Prev search result" })
|
||||
|
||||
-- Clear search, diff update and redraw
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>/",
|
||||
"<Cmd>nohlsearch<Bar>diffupdate<Bar>normal! <C-L><CR>",
|
||||
{ desc = "Redraw / clear hlsearch / diff update" }
|
||||
)
|
||||
|
||||
-- TODO: Remember the default keymaps that are difficult to change right now
|
||||
-- https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
|
||||
--
|
||||
-- map("n", "<leader>xl", "<cmd>lopen<cr>", { desc = "Location List" })
|
||||
-- map("n", "<leader>xq", "<cmd>copen<cr>", { desc = "Quickfix List" })
|
||||
-- map({ "n", "v" }, "<leader>cf", function() Util.format({ force = true }) end, { desc = "Format" })
|
||||
-- map("n", "<leader>cd", vim.diagnostic.open_float, { desc = "Line Diagnostics" })
|
||||
-- map("n", "]d", diagnostic_goto(true), { desc = "Next Diagnostic" })
|
||||
-- map("n", "[d", diagnostic_goto(false), { desc = "Prev Diagnostic" })
|
||||
-- map("n", "]e", diagnostic_goto(true, "ERROR"), { desc = "Next Error" })
|
||||
-- map("n", "[e", diagnostic_goto(false, "ERROR"), { desc = "Prev Error" })
|
||||
-- map("n", "]w", diagnostic_goto(true, "WARN"), { desc = "Next Warning" })
|
||||
-- map("n", "[w", diagnostic_goto(false, "WARN"), { desc = "Prev Warning" })
|
||||
-- map("n", "<leader>uf", function() Util.format.toggle() end, { desc = "Toggle auto format (global)" })
|
||||
-- map("n", "<leader>uF", function() Util.format.toggle(true) end, { desc = "Toggle auto format (buffer)" })
|
||||
-- map("n", "<leader>us", function() Util.toggle("spell") end, { desc = "Toggle Spelling" })
|
||||
-- map("n", "<leader>uw", function() Util.toggle("wrap") end, { desc = "Toggle Word Wrap" })
|
||||
-- map("n", "<leader>uL", function() Util.toggle("relativenumber") end, { desc = "Toggle Relative Line Numbers" })
|
||||
-- map("n", "<leader>ul", function() Util.toggle.number() end, { desc = "Toggle Line Numbers" })
|
||||
-- map("n", "<leader>ud", function() Util.toggle.diagnostics() end, { desc = "Toggle Diagnostics" })
|
||||
-- map("n", "<leader>uc", function() Util.toggle("conceallevel", false, {0, conceallevel}) end, { desc = "Toggle Conceal" })
|
||||
-- map( "n", "<leader>uh", function() Util.toggle.inlay_hints() end, { desc = "Toggle Inlay Hints" })
|
||||
-- map("n", "<leader>uT", function() if vim.b.ts_highlight then vim.treesitter.stop() else vim.treesitter.start() end end, { desc = "Toggle Treesitter Highlight" })
|
||||
-- map("n", "<leader>gg", function() Util.terminal({ "lazygit" }, { cwd = Util.root(), esc_esc = false, ctrl_hjkl = false }) end, { desc = "Lazygit (root dir)" })
|
||||
-- map("n", "<leader>gG", function() Util.terminal({ "lazygit" }, {esc_esc = false, ctrl_hjkl = false}) end, { desc = "Lazygit (cwd)" })
|
||||
-- map("n", "<leader>ui", vim.show_pos, { desc = "Inspect Pos" })
|
||||
-- map("n", "<leader>ft", lazyterm, { desc = "Terminal (root dir)" })
|
||||
-- map("n", "<leader>fT", function() Util.terminal() end, { desc = "Terminal (cwd)" })
|
||||
-- map("n", "<c-/>", lazyterm, { desc = "Terminal (root dir)" })
|
||||
-- map("n", "<c-_>", lazyterm, { desc = "which_key_ignore" })
|
||||
-- map("t", "<esc><esc>", "<c-\\><c-n>", { desc = "Enter Normal Mode" })
|
||||
-- map("t", "<C-h>", "<cmd>wincmd h<cr>", { desc = "Go to left window" })
|
||||
-- map("t", "<C-j>", "<cmd>wincmd j<cr>", { desc = "Go to lower window" })
|
||||
-- map("t", "<C-k>", "<cmd>wincmd k<cr>", { desc = "Go to upper window" })
|
||||
-- map("t", "<C-l>", "<cmd>wincmd l<cr>", { desc = "Go to right window" })
|
||||
-- map("t", "<C-/>", "<cmd>close<cr>", { desc = "Hide Terminal" })
|
||||
-- map("t", "<c-_>", "<cmd>close<cr>", { desc = "which_key_ignore" })
|
||||
|
||||
@@ -1,50 +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({
|
||||
change_detection = {
|
||||
enabled = true,
|
||||
notify = false,
|
||||
},
|
||||
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" } },
|
||||
--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,6 +1,6 @@
|
||||
-- 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
|
||||
-- Options available as-is: VimScript,
|
||||
-- Options starting with nvim_: lua
|
||||
-- To set VimScript options in lua: use either vim.opt (:help vim.opt)
|
||||
|
||||
-- Load configs from VIM
|
||||
local vim_configs = os.getenv("HOME") .. "/.vim/configs.vim"
|
||||
@@ -13,3 +13,4 @@ vim.opt.backupdir = vim.fn.stdpath("config") .. "/backup/"
|
||||
|
||||
vim.opt.wrap = true
|
||||
vim.opt.cursorline = true
|
||||
vim.opt.inccommand = "split" -- With :%s command, show the preview in a split instead of inline
|
||||
|
||||
94
common/.config/nvim/lua/plugins/coding-cmp.lua
Normal file
94
common/.config/nvim/lua/plugins/coding-cmp.lua
Normal file
@@ -0,0 +1,94 @@
|
||||
return {
|
||||
{
|
||||
-- Autocompletion
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {
|
||||
-- Snippet Engine & its associated nvim-cmp source
|
||||
"L3MON4D3/LuaSnip",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
|
||||
-- Adds LSP completion capabilities
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-path",
|
||||
|
||||
-- Adds a number of user-friendly snippets
|
||||
"rafamadriz/friendly-snippets",
|
||||
|
||||
-- Autocompletion for commands
|
||||
"hrsh7th/cmp-cmdline",
|
||||
},
|
||||
config = function()
|
||||
-- [[ Configure nvim-cmp ]]
|
||||
-- See `:help cmp`
|
||||
local cmp = require("cmp")
|
||||
local luasnip = require("luasnip")
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
luasnip.config.setup({})
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
completion = {
|
||||
completeopt = "menu,menuone,noinsert",
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-n>"] = cmp.mapping.select_next_item(),
|
||||
["<C-p>"] = cmp.mapping.select_prev_item(),
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete({}),
|
||||
["<CR>"] = cmp.mapping.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
}),
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_locally_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.locally_jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
}),
|
||||
sources = {
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "path" },
|
||||
},
|
||||
})
|
||||
|
||||
cmp.setup.cmdline("/", {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = {
|
||||
{ name = "buffer" },
|
||||
}
|
||||
})
|
||||
cmp.setup.cmdline(":", {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "path" },
|
||||
}, {
|
||||
{
|
||||
name = "cmdline",
|
||||
option = {
|
||||
ignore_cmds = { "Man", "!" }
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
end
|
||||
},
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
return {
|
||||
|
||||
-- Auto completion
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
opts = function()
|
||||
vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true })
|
||||
local cmp = require("cmp")
|
||||
local defaults = require("cmp.config.default")()
|
||||
return {
|
||||
completion = {
|
||||
completeopt = "menu,menuone,noinsert",
|
||||
},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require("luasnip").lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
|
||||
["<C-d>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-u>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<C-x>"] = cmp.mapping.abort(),
|
||||
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
["<S-CR>"] = cmp.mapping.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
}), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
["<C-CR>"] = function(fallback)
|
||||
cmp.abort()
|
||||
fallback()
|
||||
end,
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "path" },
|
||||
{ name = "luasnip" },
|
||||
}, {
|
||||
{ name = "buffer" },
|
||||
}),
|
||||
formatting = {
|
||||
format = function(_, item)
|
||||
local icons = require("lazyvim.config").icons.kinds
|
||||
if icons[item.kind] then
|
||||
item.kind = icons[item.kind] .. item.kind
|
||||
end
|
||||
return item
|
||||
end,
|
||||
},
|
||||
experimental = {
|
||||
ghost_text = {
|
||||
hl_group = "CmpGhostText",
|
||||
},
|
||||
},
|
||||
sorting = defaults.sorting,
|
||||
}
|
||||
end,
|
||||
},
|
||||
|
||||
-- Snippets
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{
|
||||
"<tab>",
|
||||
function()
|
||||
return require("luasnip").jumpable(1) and "<Plug>luasnip-jump-next" or "<tab>"
|
||||
end,
|
||||
expr = true, silent = true, mode = "i",
|
||||
},
|
||||
{ "<tab>", function() require("luasnip").jump(1) end, mode = "s" },
|
||||
{ "<s-tab>", function() require("luasnip").jump(-1) end, mode = { "i", "s" } },
|
||||
},
|
||||
},
|
||||
|
||||
-- VSCode like Snippets
|
||||
{ "rafamadriz/friendly-snippets" },
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
return {
|
||||
{ "Hoffs/omnisharp-extended-lsp.nvim" },
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
vim.list_extend(opts.ensure_installed, { "c_sharp" })
|
||||
end
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvimtools/none-ls.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
local nls = require("null-ls")
|
||||
opts.sources = opts.sources or {}
|
||||
table.insert(opts.sources, nls.builtins.formatting.csharpier)
|
||||
end,
|
||||
},
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
optional = true,
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
cs = { "csharpier" },
|
||||
},
|
||||
formatters = {
|
||||
csharpier = {
|
||||
command = "dotnet-csharpier",
|
||||
args = { "--write-stdout" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
table.insert(opts.ensure_installed, "csharpier")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
omnisharp = {
|
||||
handlers = {
|
||||
["textDocument/definition"] = function(...)
|
||||
return require("omnisharp_extended").handler(...)
|
||||
end,
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"gd",
|
||||
function()
|
||||
require("omnisharp_extended").telescope_lsp_definitions()
|
||||
end,
|
||||
desc = "Goto Definition",
|
||||
},
|
||||
},
|
||||
enable_roslyn_analyzers = true,
|
||||
organize_imports_on_format = true,
|
||||
enable_import_completion = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
85
common/.config/nvim/lua/plugins/coding-debug.lua
Normal file
85
common/.config/nvim/lua/plugins/coding-debug.lua
Normal file
@@ -0,0 +1,85 @@
|
||||
-- debug.lua
|
||||
--
|
||||
-- Shows how to use the DAP plugin to debug your code.
|
||||
--
|
||||
-- Primarily focused on configuring the debugger for Go, but can
|
||||
-- be extended to other languages as well. That's why it's called
|
||||
-- kickstart.nvim and not kitchen-sink.nvim ;)
|
||||
|
||||
return {
|
||||
"mfussenegger/nvim-dap",
|
||||
dependencies = {
|
||||
-- Creates a beautiful debugger UI
|
||||
"rcarriga/nvim-dap-ui",
|
||||
|
||||
-- Installs the debug adapters for you
|
||||
"williamboman/mason.nvim",
|
||||
"jay-babu/mason-nvim-dap.nvim",
|
||||
|
||||
-- Add your own debuggers here
|
||||
"leoluz/nvim-dap-go",
|
||||
},
|
||||
config = function()
|
||||
local dap = require("dap")
|
||||
local dapui = require("dapui")
|
||||
|
||||
require("mason-nvim-dap").setup({
|
||||
-- Makes a best effort to setup the various debuggers with
|
||||
-- reasonable debug configurations
|
||||
automatic_setup = true,
|
||||
|
||||
-- You can provide additional configuration to the handlers,
|
||||
-- see mason-nvim-dap README for more information
|
||||
handlers = {},
|
||||
|
||||
-- You'll need to check that you have the required things installed
|
||||
-- online, please don't ask me how to install them :)
|
||||
ensure_installed = {
|
||||
-- Update this to ensure that you have the debuggers for the langs you want
|
||||
"delve",
|
||||
},
|
||||
})
|
||||
|
||||
-- Basic debugging keymaps, feel free to change to your liking!
|
||||
vim.keymap.set("n", "<F5>", dap.continue, { desc = "Debug: Start/Continue" })
|
||||
vim.keymap.set("n", "<F1>", dap.step_into, { desc = "Debug: Step Into" })
|
||||
vim.keymap.set("n", "<F2>", dap.step_over, { desc = "Debug: Step Over" })
|
||||
vim.keymap.set("n", "<F3>", dap.step_out, { desc = "Debug: Step Out" })
|
||||
vim.keymap.set("n", "<leader>b", dap.toggle_breakpoint, { desc = "Debug: Toggle Breakpoint" })
|
||||
vim.keymap.set("n", "<leader>B", function()
|
||||
dap.set_breakpoint(vim.fn.input("Breakpoint condition: "))
|
||||
end, { desc = "Debug: Set Breakpoint" })
|
||||
|
||||
-- Dap UI setup
|
||||
-- For more information, see |:help nvim-dap-ui|
|
||||
dapui.setup({
|
||||
-- Set icons to characters that are more likely to work in every terminal.
|
||||
-- Feel free to remove or use ones that you like more! :)
|
||||
-- Don't feel like these are good choices.
|
||||
icons = { expanded = "▾", collapsed = "▸", current_frame = "*" },
|
||||
controls = {
|
||||
icons = {
|
||||
pause = "⏸",
|
||||
play = "▶",
|
||||
step_into = "⏎",
|
||||
step_over = "⏭",
|
||||
step_out = "⏮",
|
||||
step_back = "b",
|
||||
run_last = "▶▶",
|
||||
terminate = "⏹",
|
||||
disconnect = "⏏",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
|
||||
vim.keymap.set("n", "<F7>", dapui.toggle, { desc = "Debug: See last session result." })
|
||||
|
||||
dap.listeners.after.event_initialized["dapui_config"] = dapui.open
|
||||
dap.listeners.before.event_terminated["dapui_config"] = dapui.close
|
||||
dap.listeners.before.event_exited["dapui_config"] = dapui.close
|
||||
|
||||
-- Install golang specific config
|
||||
require("dap-go").setup()
|
||||
end,
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
return {}
|
||||
70
common/.config/nvim/lua/plugins/coding-formatting.lua
Normal file
70
common/.config/nvim/lua/plugins/coding-formatting.lua
Normal file
@@ -0,0 +1,70 @@
|
||||
-- autoformat.lua
|
||||
return {
|
||||
"neovim/nvim-lspconfig",
|
||||
config = function()
|
||||
-- Switch for controlling whether you want autoformatting.
|
||||
-- Use :KickstartFormatToggle to toggle autoformatting on or off
|
||||
local format_is_enabled = true
|
||||
vim.api.nvim_create_user_command("KickstartFormatToggle", function()
|
||||
format_is_enabled = not format_is_enabled
|
||||
print("Setting autoformatting to: " .. tostring(format_is_enabled))
|
||||
end, {})
|
||||
|
||||
-- Create an augroup that is used for managing our formatting autocmds.
|
||||
-- We need one augroup per client to make sure that multiple clients
|
||||
-- can attach to the same buffer without interfering with each other.
|
||||
local _augroups = {}
|
||||
local get_augroup = function(client)
|
||||
if not _augroups[client.id] then
|
||||
local group_name = "kickstart-lsp-format-" .. client.name
|
||||
local id = vim.api.nvim_create_augroup(group_name, { clear = true })
|
||||
_augroups[client.id] = id
|
||||
end
|
||||
|
||||
return _augroups[client.id]
|
||||
end
|
||||
|
||||
-- Whenever an LSP attaches to a buffer, we will run this function.
|
||||
--
|
||||
-- See `:help LspAttach` for more information about this autocmd event.
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = vim.api.nvim_create_augroup("kickstart-lsp-attach-format", { clear = true }),
|
||||
-- This is where we attach the autoformatting for reasonable clients
|
||||
callback = function(args)
|
||||
local client_id = args.data.client_id
|
||||
local client = vim.lsp.get_client_by_id(client_id)
|
||||
local bufnr = args.buf
|
||||
|
||||
-- Only attach to clients that support document formatting
|
||||
if not client.server_capabilities.documentFormattingProvider then
|
||||
return
|
||||
end
|
||||
|
||||
-- Tsserver usually works poorly. Sorry you work with bad languages
|
||||
-- You can remove this line if you know what you're doing :)
|
||||
if client.name == "tsserver" then
|
||||
return
|
||||
end
|
||||
|
||||
-- Create an autocmd that will run *before* we save the buffer.
|
||||
-- Run the formatting command for the LSP that has just attached.
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
group = get_augroup(client),
|
||||
buffer = bufnr,
|
||||
callback = function()
|
||||
if not format_is_enabled then
|
||||
return
|
||||
end
|
||||
|
||||
vim.lsp.buf.format({
|
||||
async = false,
|
||||
filter = function(c)
|
||||
return c.id == client.id
|
||||
end,
|
||||
})
|
||||
end,
|
||||
})
|
||||
end,
|
||||
})
|
||||
end,
|
||||
}
|
||||
74
common/.config/nvim/lua/plugins/coding-generic.lua
Normal file
74
common/.config/nvim/lua/plugins/coding-generic.lua
Normal file
@@ -0,0 +1,74 @@
|
||||
return {
|
||||
{ "tpope/vim-repeat" },
|
||||
{ "tpope/vim-surround" },
|
||||
{ "easymotion/vim-easymotion" },
|
||||
{ "machakann/vim-highlightedyank" },
|
||||
|
||||
-- "gc" to comment visual regions/lines
|
||||
{ "numToStr/Comment.nvim", opts = {} },
|
||||
|
||||
-- auto pairs
|
||||
{
|
||||
"echasnovski/mini.pairs",
|
||||
event = "VeryLazy",
|
||||
opts = {},
|
||||
},
|
||||
|
||||
-- indent guides for Neovim
|
||||
{
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
opts = {
|
||||
indent = { char = "│", tab_char = "│", },
|
||||
scope = { enabled = false },
|
||||
exclude = {
|
||||
filetypes = {
|
||||
"help", "alpha", "dashboard", "neo-tree",
|
||||
"Trouble", "trouble", "lazy", "mason",
|
||||
"notify", "toggleterm", "lazyterm",
|
||||
},
|
||||
},
|
||||
},
|
||||
main = "ibl",
|
||||
},
|
||||
|
||||
-- Highlights the current level of indentation, and animates the highlighting.
|
||||
{
|
||||
"echasnovski/mini.indentscope",
|
||||
opts = { symbol = "│", options = { try_as_border = true }, },
|
||||
init = function()
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = {
|
||||
"help", "neo-tree", "Trouble", "trouble",
|
||||
"lazy", "mason", "notify", "toggleterm",
|
||||
"lazyterm",
|
||||
},
|
||||
callback = function()
|
||||
vim.b.miniindentscope_disable = true
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Finds and lists all of the TODO, HACK, BUG, etc comment
|
||||
{
|
||||
"folke/todo-comments.nvim",
|
||||
lazy = false,
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = true,
|
||||
opts = {
|
||||
keywords = {
|
||||
HACK = { alt = { "TIP" } },
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{ "]t", function() require("todo-comments").jump_next() end, desc = "Next todo comment" },
|
||||
{ "[t", function() require("todo-comments").jump_prev() end, desc = "Previous todo comment" },
|
||||
|
||||
-- TODO: Find better keymaps for below
|
||||
-- { "<leader>xt", "<cmd>TodoTrouble<cr>", desc = "Todo (Trouble)" },
|
||||
-- { "<leader>xT", "<cmd>TodoTrouble keywords=TODO,FIX,FIXME<cr>", desc = "Todo/Fix/Fixme (Trouble)" },
|
||||
-- { "<leader>st", "<cmd>TodoTelescope<cr>", desc = "Todo" },
|
||||
-- { "<leader>sT", "<cmd>TodoTelescope keywords=TODO,FIX,FIXME<cr>", desc = "Todo/Fix/Fixme" },
|
||||
},
|
||||
},
|
||||
}
|
||||
74
common/.config/nvim/lua/plugins/coding-git.lua
Normal file
74
common/.config/nvim/lua/plugins/coding-git.lua
Normal file
@@ -0,0 +1,74 @@
|
||||
return {
|
||||
|
||||
{ "tpope/vim-fugitive", },
|
||||
--{ "tpope/vim-rhubarb" }, --If fugitive.vim is the Git, rhubarb.vim is the Hub.
|
||||
|
||||
{
|
||||
-- Adds git related signs to the gutter, as well as utilities for managing changes
|
||||
"lewis6991/gitsigns.nvim",
|
||||
opts = {
|
||||
-- See `:help gitsigns.txt`
|
||||
signs = {
|
||||
add = { text = "+" },
|
||||
change = { text = "~" },
|
||||
delete = { text = "_" },
|
||||
topdelete = { text = "‾" },
|
||||
changedelete = { text = "~" },
|
||||
},
|
||||
on_attach = function(bufnr)
|
||||
local gs = package.loaded.gitsigns
|
||||
|
||||
local function map(mode, l, r, opts)
|
||||
opts = opts or {}
|
||||
opts.buffer = bufnr
|
||||
vim.keymap.set(mode, l, r, opts)
|
||||
end
|
||||
|
||||
-- Navigation
|
||||
map({ "n", "v" }, "]h", function()
|
||||
if vim.wo.diff then
|
||||
return "]h"
|
||||
end
|
||||
vim.schedule(function()
|
||||
gs.next_hunk()
|
||||
end)
|
||||
return "<Ignore>"
|
||||
end, { expr = true, desc = "Jump to next git hunk" })
|
||||
|
||||
map({ "n", "v" }, "[h", function()
|
||||
if vim.wo.diff then
|
||||
return "[h"
|
||||
end
|
||||
vim.schedule(function()
|
||||
gs.prev_hunk()
|
||||
end)
|
||||
return "<Ignore>"
|
||||
end, { expr = true, desc = "Jump to previous git hunk" })
|
||||
|
||||
-- Actions
|
||||
-- visual mode
|
||||
map("v", "<leader>ghr", function()
|
||||
gs.reset_hunk({ vim.fn.line("."), vim.fn.line("v") })
|
||||
end, { desc = "reset git hunk" })
|
||||
-- normal mode
|
||||
map("n", "<leader>ghp", gs.preview_hunk, { desc = "preview git hunk" })
|
||||
|
||||
map("n", "<leader>ghr", gs.reset_hunk, { desc = "git reset hunk" })
|
||||
map("n", "<leader>ghb", function()
|
||||
gs.blame_line({ full = false })
|
||||
end, { desc = "git blame line" })
|
||||
map("n", "<leader>ghD", gs.diffthis, { desc = "git diff against index" })
|
||||
map("n", "<leader>ghd", function()
|
||||
gs.diffthis("~")
|
||||
end, { desc = "git diff against last commit" })
|
||||
|
||||
-- Toggles
|
||||
map("n", "<leader>gtb", gs.toggle_current_line_blame, { desc = "toggle git blame line" })
|
||||
map("n", "<leader>gtd", gs.toggle_deleted, { desc = "toggle git show deleted" })
|
||||
|
||||
-- Text object
|
||||
map({ "o", "x" }, "gih", ":<C-U>Gitsigns select_hunk<CR>", { desc = "select git hunk" })
|
||||
end,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
return {}
|
||||
144
common/.config/nvim/lua/plugins/coding-lsp.lua
Normal file
144
common/.config/nvim/lua/plugins/coding-lsp.lua
Normal file
@@ -0,0 +1,144 @@
|
||||
-- This function gets run when an LSP connects to a particular buffer.
|
||||
-- Define mappings specific for LSP related items.
|
||||
-- It sets the mode, buffer and description for us each time.
|
||||
local on_attach = function(_, bufnr)
|
||||
local nmap = function(keys, func, desc)
|
||||
if desc then
|
||||
desc = "LSP: " .. desc
|
||||
end
|
||||
|
||||
vim.keymap.set("n", keys, func, { buffer = bufnr, desc = desc })
|
||||
end
|
||||
|
||||
nmap("<leader>rn", vim.lsp.buf.rename, "[R]e[n]ame")
|
||||
nmap("<leader>ca", vim.lsp.buf.code_action, "[C]ode [A]ction")
|
||||
|
||||
nmap("gd", require("telescope.builtin").lsp_definitions, "[G]oto [D]efinition")
|
||||
nmap("gr", require("telescope.builtin").lsp_references, "[G]oto [R]eferences")
|
||||
nmap("gI", require("telescope.builtin").lsp_implementations, "[G]oto [I]mplementation")
|
||||
nmap("<leader>D", require("telescope.builtin").lsp_type_definitions, "Type [D]efinition")
|
||||
nmap("<leader>ds", require("telescope.builtin").lsp_document_symbols, "[D]ocument [S]ymbols")
|
||||
nmap("<leader>ws", require("telescope.builtin").lsp_dynamic_workspace_symbols, "[W]orkspace [S]ymbols")
|
||||
|
||||
-- See `:help K` for why this keymap
|
||||
nmap("K", vim.lsp.buf.hover, "Hover Documentation")
|
||||
nmap("<C-k>", vim.lsp.buf.signature_help, "Signature Documentation")
|
||||
|
||||
-- Lesser used LSP functionality
|
||||
nmap("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration")
|
||||
nmap("<leader>wa", vim.lsp.buf.add_workspace_folder, "[W]orkspace [A]dd Folder")
|
||||
nmap("<leader>wr", vim.lsp.buf.remove_workspace_folder, "[W]orkspace [R]emove Folder")
|
||||
nmap("<leader>wl", function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, "[W]orkspace [L]ist Folders")
|
||||
|
||||
-- Create a command `:Format` local to the LSP buffer
|
||||
vim.api.nvim_buf_create_user_command(bufnr, "Format", function(_)
|
||||
vim.lsp.buf.format()
|
||||
end, { desc = "Format current buffer with LSP" })
|
||||
end
|
||||
|
||||
return {
|
||||
{
|
||||
-- LSP Configuration & Plugins
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
-- Automatically install LSPs to stdpath for neovim
|
||||
{ "williamboman/mason.nvim", config = true },
|
||||
{ "williamboman/mason-lspconfig.nvim" },
|
||||
|
||||
-- Useful status updates for LSP
|
||||
{ "j-hui/fidget.nvim", opts = {} },
|
||||
|
||||
{ "folke/neodev.nvim" },
|
||||
},
|
||||
-- WARN: DO NOT do config here
|
||||
-- That would override config from autoformat
|
||||
},
|
||||
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
config = function()
|
||||
-- NOTE: We configure lsp here instead of in the lspconfig's config
|
||||
-- Reason? read the warnings above
|
||||
|
||||
-- Configure LSP
|
||||
|
||||
-- mason-lspconfig requires that these setup functions are called in this order
|
||||
-- before setting up the servers.
|
||||
require("mason").setup()
|
||||
require("mason-lspconfig").setup()
|
||||
|
||||
-- Enable the following language servers
|
||||
-- Add any additional override configuration in the following tables. They will be passed to
|
||||
-- the `settings` field of the server config. You must look up that documentation yourself.
|
||||
--
|
||||
-- If you want to override the default filetypes that your language server will attach to you can
|
||||
-- define the property 'filetypes' to the map in question.
|
||||
local servers = {
|
||||
-- clangd = {},
|
||||
-- gopls = {},
|
||||
-- pyright = {},
|
||||
-- rust_analyzer = {},
|
||||
-- tsserver = {},
|
||||
-- html = { filetypes = { 'html', 'twig', 'hbs'} },
|
||||
|
||||
lua_ls = {
|
||||
Lua = {
|
||||
workspace = { checkThirdParty = false },
|
||||
telemetry = { enable = false },
|
||||
-- NOTE: toggle below to ignore Lua_LS's noisy `missing-fields` warnings
|
||||
-- diagnostics = { disable = { 'missing-fields' } },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- nvim-cmp supports additional completion capabilities, so broadcast that to servers
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities)
|
||||
|
||||
-- Ensure the servers above are installed
|
||||
local mason_lspconfig = require("mason-lspconfig")
|
||||
|
||||
mason_lspconfig.setup({
|
||||
ensure_installed = vim.tbl_keys(servers),
|
||||
})
|
||||
|
||||
mason_lspconfig.setup_handlers({
|
||||
function(server_name)
|
||||
require("lspconfig")[server_name].setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = servers[server_name],
|
||||
filetypes = (servers[server_name] or {}).filetypes,
|
||||
})
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"j-hui/fidget.nvim",
|
||||
opts = {
|
||||
-- Options related to LSP progress subsystem
|
||||
progress = {
|
||||
poll_rate = 1, -- How and when to poll for progress messages
|
||||
suppress_on_insert = true, -- Suppress new messages while in insert mode
|
||||
ignore_done_already = true, -- Ignore new tasks that are already complete
|
||||
ignore_empty_message = true, -- Ignore new tasks that don't contain a message
|
||||
ignore = {}, -- List of LSP servers to ignore
|
||||
|
||||
-- Options related to how LSP progress messages are displayed as notifications
|
||||
display = {
|
||||
render_limit = 1, -- How many LSP messages to show at once
|
||||
skip_history = true, -- Whether progress notifications should be omitted from history
|
||||
},
|
||||
},
|
||||
|
||||
-- Options related to notification subsystem
|
||||
notification = {
|
||||
filter = vim.log.levels.WARN, -- Minimum notifications level
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
return {}
|
||||
@@ -1 +0,0 @@
|
||||
return {}
|
||||
@@ -1 +0,0 @@
|
||||
return {}
|
||||
@@ -1 +0,0 @@
|
||||
return {}
|
||||
@@ -1 +0,0 @@
|
||||
return {}
|
||||
@@ -1 +0,0 @@
|
||||
return {}
|
||||
@@ -1,293 +0,0 @@
|
||||
return {
|
||||
|
||||
-- FIX: Vale (markdown linter) isn't working
|
||||
-- TODO: Configure the linter
|
||||
|
||||
-- Treesitter is a parser generator tool that we can use for syntax highlighting
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
lazy = false,
|
||||
keys = {
|
||||
{ "<C-Space>", desc = "Increment selection" },
|
||||
{ "<C-CR>", desc = "Increment scope selection" },
|
||||
{ "<bs>", desc = "Decrement selection", mode = "x" },
|
||||
},
|
||||
---@type TSConfig
|
||||
---@diagnostic disable-next-line: missing-fields
|
||||
opts = {
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
auto_install = true,
|
||||
-- stylua: ignore
|
||||
ensure_installed = {
|
||||
"lua", "luadoc", "luap", "vim", "vimdoc",
|
||||
"diff","query", "regex", "toml", "yaml",
|
||||
"c", "python", "bash",
|
||||
"markdown", "markdown_inline",
|
||||
"html", "javascript", "jsdoc", "json", "jsonc", "tsx", "typescript",
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<C-space>",
|
||||
node_incremental = "<C-space>",
|
||||
scope_incremental = "<C-CR>",
|
||||
node_decremental = "<bs>",
|
||||
},
|
||||
},
|
||||
textobjects = {
|
||||
-- stylua: ignore
|
||||
-- Defaults(not mentioned below): Select text objects (similar to ip & ap)
|
||||
-- af: Selects around current function
|
||||
-- if: Selects inside current function
|
||||
-- ac: around current Class
|
||||
-- ic: inside current Class
|
||||
move = {
|
||||
-- Jump to next and previous text objects
|
||||
enable = true,
|
||||
goto_next_start = {
|
||||
["]f"] = { query = "@function.outer", desc = "Goto next inner function start" },
|
||||
["]c"] = { query = "@class.outer", desc = "Goto next inner class start" },
|
||||
},
|
||||
goto_next_end = {
|
||||
["]F"] = { query = "@function.outer", desc = "Goto next outer function end" },
|
||||
["]C"] = { query = "@class.outer", desc = "Goto next outer class end" },
|
||||
},
|
||||
goto_previous_start = {
|
||||
["[f"] = { query = "@function.outer", desc = "Goto goto previous inner function start" },
|
||||
["[c"] = { query = "@class.outer", desc = "Previous inner class start" },
|
||||
},
|
||||
goto_previous_end = {
|
||||
["[F"] = { query = "@function.outer", desc = "Goto goto previous outer function start" },
|
||||
["[C"] = { query = "@class.outer", desc = "Goto previous outer class start" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- LSP configuration
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
-- lazy = false,
|
||||
opts = {
|
||||
-- Enable this to enable the builtin LSP inlay hints on Neovim >= 0.10.0
|
||||
-- Be aware that you also will need to properly configure your LSP server to
|
||||
-- provide the inlay hints.
|
||||
inlay_hints = {
|
||||
enabled = true,
|
||||
},
|
||||
-- add any global capabilities here
|
||||
capabilities = {},
|
||||
-- options for vim.lsp.buf.format
|
||||
-- `bufnr` and `filter` is handled by the LazyVim formatter,
|
||||
-- but can be also overridden when specified
|
||||
format = {
|
||||
formatting_options = nil,
|
||||
timeout_ms = nil,
|
||||
},
|
||||
-- LSP Server Settings
|
||||
servers = {
|
||||
lua_ls = {
|
||||
settings = {
|
||||
Lua = {
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
},
|
||||
completion = {
|
||||
callSnippet = "Replace",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
tsserver = {
|
||||
keys = {
|
||||
{
|
||||
"<leader>co",
|
||||
function()
|
||||
vim.lsp.buf.code_action({
|
||||
apply = true,
|
||||
context = {
|
||||
only = { "source.organizeImports.ts" },
|
||||
diagnostics = {},
|
||||
},
|
||||
})
|
||||
end,
|
||||
desc = "Organize Imports",
|
||||
},
|
||||
{
|
||||
"<leader>cR",
|
||||
function()
|
||||
vim.lsp.buf.code_action({
|
||||
apply = true,
|
||||
context = {
|
||||
only = { "source.removeUnused.ts" },
|
||||
diagnostics = {},
|
||||
},
|
||||
})
|
||||
end,
|
||||
desc = "Remove Unused Imports",
|
||||
},
|
||||
},
|
||||
settings = {
|
||||
typescript = {
|
||||
format = {},
|
||||
},
|
||||
javascript = {
|
||||
format = {},
|
||||
},
|
||||
completions = {
|
||||
completeFunctionCalls = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Linting
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
lazy = false,
|
||||
opts = {
|
||||
-- Event to trigger linters
|
||||
events = { "BufWritePost", "BufReadPost", "InsertLeave" },
|
||||
linters_by_ft = {
|
||||
fish = { "fish" },
|
||||
-- Use the "*" filetype to run linters on all filetypes.
|
||||
-- ['*'] = { 'global linter' },
|
||||
-- Use the "_" filetype to run linters on filetypes that don't have other linters configured.
|
||||
-- ['_'] = { 'fallback linter' },
|
||||
},
|
||||
-- LazyVim extension to easily override linter options
|
||||
-- or add custom linters.
|
||||
---@type table<string,table>
|
||||
linters = {
|
||||
-- -- Example of using selene only when a selene.toml file is present
|
||||
-- selene = {
|
||||
-- -- `condition` is another LazyVim extension that allows you to
|
||||
-- -- dynamically enable/disable linters based on the context.
|
||||
-- condition = function(ctx)
|
||||
-- return vim.fs.find({ "selene.toml" }, { path = ctx.filename, upward = true })[1]
|
||||
-- end,
|
||||
-- },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Mason configuration
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"prettier",
|
||||
"js-debug-adapter",
|
||||
"eslint-lsp",
|
||||
"json-lsp",
|
||||
"typescript-language-server",
|
||||
"codelldb",
|
||||
"rust-analyzer",
|
||||
"yaml-language-server",
|
||||
"black",
|
||||
"csharpier",
|
||||
"omnisharp",
|
||||
"stylua",
|
||||
"lua-language-server",
|
||||
"shfmt",
|
||||
"pyright",
|
||||
"hadolint",
|
||||
"docker-compose-language-service",
|
||||
"dockerfile-language-server",
|
||||
"vale",
|
||||
"vale-ls",
|
||||
"markdownlint",
|
||||
"marksman",
|
||||
"taplo",
|
||||
},
|
||||
},
|
||||
},
|
||||
{ "williamboman/mason-lspconfig.nvim" },
|
||||
|
||||
-- Formatter
|
||||
{
|
||||
"nvimtools/none-ls.nvim",
|
||||
lazy = false,
|
||||
opts = function(_, opts)
|
||||
local nls = require("null-ls")
|
||||
opts.root_dir = opts.root_dir
|
||||
or require("null-ls.utils").root_pattern(".null-ls-root", ".neoconf.json", "Makefile", ".git")
|
||||
opts.sources = vim.list_extend(opts.sources or {}, {
|
||||
nls.builtins.formatting.fish_indent,
|
||||
nls.builtins.diagnostics.fish,
|
||||
nls.builtins.formatting.stylua,
|
||||
nls.builtins.formatting.shfmt,
|
||||
nls.builtins.formatting.eslint_d,
|
||||
nls.builtins.formatting.black,
|
||||
nls.builtins.formatting.prettierd,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Auto pairs
|
||||
{ "echasnovski/mini.pairs" },
|
||||
|
||||
-- Automatically add closing tags for HTML and JSX
|
||||
{ "windwp/nvim-ts-autotag" },
|
||||
|
||||
-- Surround things
|
||||
{ "tpope/vim-surround" },
|
||||
-- Tpope one(above) is more predictable
|
||||
{ "echasnovski/mini.surround", enabled = false },
|
||||
|
||||
-- Comments
|
||||
{ "JoosepAlviste/nvim-ts-context-commentstring" },
|
||||
{ "echasnovski/mini.comment" },
|
||||
|
||||
-- Better text-objects
|
||||
{
|
||||
-- Extends a & i with the following:
|
||||
-- a/i <space>: around/inside continuous Whitespace
|
||||
-- a/i ": around/inside double quotes
|
||||
-- a/i ': around/inside single quotes
|
||||
-- a/i `: around/inside backticks
|
||||
-- a/i q: around/inside any 2 quotes of any kind (`, ', ")
|
||||
|
||||
-- a/i (: around/inside braces - does NOT include spaces around
|
||||
-- a/i ): around/inside braces - DOES include spaces around
|
||||
-- a/i ]/[
|
||||
-- a/i }/{
|
||||
-- a/i b: around/inside any 2 braces of any kind (), ], }) - NOT including spaces around
|
||||
|
||||
-- a/i >: around/inside tags - does NOT include spaces
|
||||
-- a/i <: around/inside tags - DOES include spaces
|
||||
-- a/i t: around/inside 2 tags of any kind
|
||||
|
||||
-- a/i _: around/inside 2 Underscores
|
||||
|
||||
-- a/i a: around/inside function arguments
|
||||
-- a/i f: around/inside Function
|
||||
-- a/i c: around/inside class
|
||||
-- a/i o: around/inside any block of code (conditional, loop, etc.)
|
||||
"echasnovski/mini.ai",
|
||||
},
|
||||
|
||||
-- Indent guides for Neovim
|
||||
{
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
opts = { scope = { enabled = true } },
|
||||
},
|
||||
|
||||
-- This highlights the current level of indentation and animates the highlighting
|
||||
{ "echasnovski/mini.indentscope" },
|
||||
|
||||
-- Navic does a much better job without taking any screen space
|
||||
{ "nvim-treesitter/nvim-treesitter-context", enabled = false },
|
||||
-- VSCode like breadcrumbs in lualine
|
||||
{ "SmiteshP/nvim-navic" },
|
||||
|
||||
-- Shows symbols in the current window on a vsplit on left
|
||||
{
|
||||
"simrat39/symbols-outline.nvim",
|
||||
keys = { { "<leader>cs", "<cmd>SymbolsOutline<cr>", desc = "Symbols Outline" } },
|
||||
},
|
||||
}
|
||||
@@ -1,16 +1,10 @@
|
||||
return {
|
||||
{
|
||||
"LazyVim/LazyVim",
|
||||
opts = {
|
||||
colorscheme = "github_dark_dimmed",
|
||||
},
|
||||
},
|
||||
{
|
||||
"projekt0n/github-nvim-theme",
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
config = function()
|
||||
-- vim.cmd("colorscheme github_dark_dimmed")
|
||||
vim.cmd("colorscheme github_dark_dimmed")
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
-- Most of the code below is for easy reference to lazyvim shortcuts
|
||||
-- So, I can view and change them easily
|
||||
|
||||
local Util = require("lazyvim.util")
|
||||
|
||||
return {
|
||||
|
||||
-- icons
|
||||
{ "nvim-tree/nvim-web-devicons" },
|
||||
|
||||
-- Changes the Nvim root to git root
|
||||
{
|
||||
"airblade/vim-rooter",
|
||||
@@ -21,37 +13,14 @@ return {
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
keys = {
|
||||
{ "<leader>e", ":Neotree filesystem toggle<CR>", desc = "Explorer NeoTree (root dir)", remap = true },
|
||||
{ "<leader>e", ":Neotree filesystem toggle<CR>", desc = "Open NeoTree [E]plorer at Git root", remap = true },
|
||||
|
||||
-- Change the rest if required
|
||||
{
|
||||
"<leader>fe",
|
||||
function()
|
||||
require("neo-tree.command").execute({ toggle = true, dir = Util.root() })
|
||||
end,
|
||||
desc = "Explorer NeoTree (root dir)",
|
||||
},
|
||||
{
|
||||
"<leader>fE",
|
||||
function()
|
||||
require("neo-tree.command").execute({ toggle = true, dir = vim.loop.cwd() })
|
||||
end,
|
||||
desc = "Explorer NeoTree (cwd)",
|
||||
},
|
||||
{ "<leader>E", "<leader>fE", desc = "Explorer NeoTree (cwd)", remap = true },
|
||||
{
|
||||
"<leader>ge",
|
||||
function()
|
||||
require("neo-tree.command").execute({ source = "git_status", toggle = true })
|
||||
end,
|
||||
desc = "Git explorer",
|
||||
},
|
||||
{
|
||||
"<leader>be",
|
||||
function()
|
||||
require("neo-tree.command").execute({ source = "buffers", toggle = true })
|
||||
end,
|
||||
desc = "Buffer explorer",
|
||||
desc = "NeoTree: Open [B]uffer [E]xplorer",
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
@@ -72,9 +41,9 @@ return {
|
||||
},
|
||||
window = {
|
||||
position = "left",
|
||||
width = 30, -- Saner window size
|
||||
width = 30, -- Saner window size
|
||||
mappings = {
|
||||
["s"] = "open_split", -- Default vim keymap for horizontal split
|
||||
["s"] = "open_split", -- Default vim keymap for horizontal split
|
||||
["v"] = "open_vsplit", -- Default vim keymap for vertical split
|
||||
},
|
||||
},
|
||||
@@ -88,150 +57,11 @@ return {
|
||||
},
|
||||
},
|
||||
|
||||
-- Search and replace in multiple files
|
||||
{
|
||||
"nvim-pack/nvim-spectre",
|
||||
keys = {
|
||||
{
|
||||
"<leader>sr",
|
||||
function()
|
||||
require("spectre").open()
|
||||
end,
|
||||
desc = "Replace in files (Spectre)",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Fuzzy finder of many things
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
keys = {
|
||||
-- find
|
||||
{ "<leader>ff", Util.telescope("files"), desc = "Find Files (root dir)" },
|
||||
{ "<leader><space>", Util.telescope("files"), desc = "Find Files (root dir)" },
|
||||
{ "<leader>fb", "<cmd>Telescope buffers sort_mru=true sort_lastused=true<cr>", desc = "Buffers" },
|
||||
{ "<leader>fc", Util.telescope.config_files(), desc = "Find Config File" },
|
||||
{ "<leader>fF", Util.telescope("files", { cwd = false }), desc = "Find Files (cwd)" },
|
||||
{ "<leader>fr", "<cmd>Telescope oldfiles<cr>", desc = "Recent" },
|
||||
{ "<leader>fR", Util.telescope("oldfiles", { cwd = vim.loop.cwd() }), desc = "Recent (cwd)" },
|
||||
{ "<leader>/", Util.telescope("live_grep"), desc = "Grep (root dir)" },
|
||||
{ "<leader>:", "<cmd>Telescope command_history<cr>", desc = "Command History" },
|
||||
|
||||
-- git
|
||||
{ "<leader>gc", "<cmd>Telescope git_commits<CR>", desc = "commits" },
|
||||
{ "<leader>gs", "<cmd>Telescope git_status<CR>", desc = "status" },
|
||||
|
||||
-- search
|
||||
{ '<leader>s"', "<cmd>Telescope registers<cr>", desc = "Registers" },
|
||||
{ "<leader>sa", "<cmd>Telescope autocommands<cr>", desc = "Auto Commands" },
|
||||
{ "<leader>sb", "<cmd>Telescope current_buffer_fuzzy_find<cr>", desc = "Buffer" },
|
||||
{ "<leader>sc", "<cmd>Telescope command_history<cr>", desc = "Command History" },
|
||||
{ "<leader>sC", "<cmd>Telescope commands<cr>", desc = "Commands" },
|
||||
{ "<leader>sd", "<cmd>Telescope diagnostics bufnr=0<cr>", desc = "Document diagnostics" },
|
||||
{ "<leader>sD", "<cmd>Telescope diagnostics<cr>", desc = "Workspace diagnostics" },
|
||||
{ "<leader>sg", Util.telescope("live_grep"), desc = "Grep (root dir)" },
|
||||
{ "<leader>sG", Util.telescope("live_grep", { cwd = false }), desc = "Grep (cwd)" },
|
||||
{ "<leader>sh", "<cmd>Telescope help_tags<cr>", desc = "Help Pages" },
|
||||
{ "<leader>sH", "<cmd>Telescope highlights<cr>", desc = "Search Highlight Groups" },
|
||||
{ "<leader>sk", "<cmd>Telescope keymaps<cr>", desc = "Key Maps" },
|
||||
{ "<leader>sM", "<cmd>Telescope man_pages<cr>", desc = "Man Pages" },
|
||||
{ "<leader>sm", "<cmd>Telescope marks<cr>", desc = "Jump to Mark" },
|
||||
{ "<leader>so", "<cmd>Telescope vim_options<cr>", desc = "Options" },
|
||||
{ "<leader>sR", "<cmd>Telescope resume<cr>", desc = "Resume" },
|
||||
{ "<leader>sw", Util.telescope("grep_string", { word_match = "-w" }), desc = "Word (root dir)" },
|
||||
{ "<leader>sW", Util.telescope("grep_string", { cwd = false, word_match = "-w" }), desc = "Word (cwd)" },
|
||||
{ "<leader>sw", Util.telescope("grep_string"), mode = "v", desc = "Selection (root dir)" },
|
||||
{ "<leader>sW", Util.telescope("grep_string", { cwd = false }), mode = "v", desc = "Selection (cwd)" },
|
||||
{
|
||||
"<leader>uC",
|
||||
Util.telescope("colorscheme", { enable_preview = true }),
|
||||
desc = "Colorscheme with preview",
|
||||
},
|
||||
{
|
||||
"<leader>ss",
|
||||
function()
|
||||
require("telescope.builtin").lsp_document_symbols({
|
||||
symbols = require("lazyvim.config").get_kind_filter(),
|
||||
})
|
||||
end,
|
||||
desc = "Goto Symbol",
|
||||
},
|
||||
{
|
||||
"<leader>sS",
|
||||
function()
|
||||
require("telescope.builtin").lsp_dynamic_workspace_symbols({
|
||||
symbols = require("lazyvim.config").get_kind_filter(),
|
||||
})
|
||||
end,
|
||||
desc = "Goto Symbol (Workspace)",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Confusing hence disabled
|
||||
{ "folke/flash.nvim", enabled = false },
|
||||
-- EasyMotion is better
|
||||
{ "easymotion/vim-easymotion" },
|
||||
|
||||
-- Adds and reads "keys" property in each plugins
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
plugins = { spelling = true },
|
||||
defaults = {
|
||||
mode = { "n", "v" },
|
||||
["g"] = { name = "+goto" },
|
||||
["ys"] = { name = "+surround" },
|
||||
["]"] = { name = "+next" },
|
||||
["["] = { name = "+prev" },
|
||||
["<leader><tab>"] = { name = "+tabs" },
|
||||
["<leader>b"] = { name = "+buffer" },
|
||||
["<leader>c"] = { name = "+code" },
|
||||
["<leader>f"] = { name = "+file/find" },
|
||||
["<leader>g"] = { name = "+git" },
|
||||
["<leader>gh"] = { name = "+hunks" },
|
||||
["<leader>q"] = { name = "+quit/session" },
|
||||
["<leader>s"] = { name = "+search" },
|
||||
["<leader>u"] = { name = "+ui" },
|
||||
["<leader>w"] = { name = "+windows" },
|
||||
["<leader>x"] = { name = "+diagnostics/quickfix" },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Display undotree
|
||||
{
|
||||
"mbbill/undotree",
|
||||
config = function()
|
||||
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
|
||||
end,
|
||||
},
|
||||
|
||||
-- TODO: install gitblame plugin
|
||||
|
||||
-- Highlights text that changed since last commit
|
||||
{
|
||||
"lewis6991/gitsigns.nvim",
|
||||
opts = {
|
||||
on_attach = function(buffer)
|
||||
local gs = package.loaded.gitsigns
|
||||
local function map(mode, l, r, desc)
|
||||
vim.keymap.set(mode, l, r, { buffer = buffer, desc = desc })
|
||||
end
|
||||
|
||||
-- stylua: ignore start
|
||||
map("n", "<leader>ghp", gs.preview_hunk, "Preview Hunk")
|
||||
map("n", "<leader>gH", gs.preview_hunk, "Preview Hunk")
|
||||
map("n", "]h", gs.next_hunk, "Next Hunk")
|
||||
map("n", "[h", gs.prev_hunk, "Prev Hunk")
|
||||
end,
|
||||
},
|
||||
},
|
||||
|
||||
-- Automatically highlights other instances of the word under cursor
|
||||
{
|
||||
"RRethy/vim-illuminate",
|
||||
config = function(_, opts)
|
||||
-- Copied from LazyNvim
|
||||
require("illuminate").configure(opts)
|
||||
|
||||
local function map(key, dir, buffer)
|
||||
@@ -258,168 +88,61 @@ return {
|
||||
},
|
||||
},
|
||||
|
||||
-- Remove Buffer
|
||||
-- Display undotree
|
||||
{
|
||||
"echasnovski/mini.bufremove",
|
||||
keys = {
|
||||
{
|
||||
"<leader>br",
|
||||
function()
|
||||
if vim.bo.modified then
|
||||
vim.cmd.write()
|
||||
end
|
||||
require("mini.bufremove").delete(0)
|
||||
end,
|
||||
desc = "Save and remove Buffer",
|
||||
},
|
||||
-- stylua: ignore
|
||||
{ "<leader>bR", function() require("mini.bufremove").delete(0, true) end, desc = "Force Remove Buffer" },
|
||||
},
|
||||
"mbbill/undotree",
|
||||
config = function()
|
||||
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
|
||||
end,
|
||||
},
|
||||
|
||||
-- Diagnostics lists
|
||||
-- Show buffers like VS Code tabs
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
"akinsho/bufferline.nvim",
|
||||
dependencies = {
|
||||
{ "echasnovski/mini.bufremove", version = "*" },
|
||||
},
|
||||
event = "VeryLazy",
|
||||
keys = {
|
||||
{ "<leader>xx", "<cmd>TroubleToggle document_diagnostics<cr>", desc = "Document Diagnostics (Trouble)" },
|
||||
{ "<leader>xX", "<cmd>TroubleToggle workspace_diagnostics<cr>", desc = "Workspace Diagnostics (Trouble)" },
|
||||
{ "<leader>xL", "<cmd>TroubleToggle loclist<cr>", desc = "Location List (Trouble)" },
|
||||
{ "<leader>xQ", "<cmd>TroubleToggle quickfix<cr>", desc = "Quickfix List (Trouble)" },
|
||||
{
|
||||
"[e",
|
||||
function()
|
||||
if require("trouble").is_open() then
|
||||
require("trouble").previous({ skip_groups = true, jump = true })
|
||||
else
|
||||
local ok, err = pcall(vim.cmd.cprev)
|
||||
if not ok then
|
||||
vim.notify(err, vim.log.levels.ERROR)
|
||||
end
|
||||
end
|
||||
end,
|
||||
desc = "Previous trouble/quickfix item",
|
||||
},
|
||||
{
|
||||
"]e",
|
||||
function()
|
||||
if require("trouble").is_open() then
|
||||
require("trouble").next({ skip_groups = true, jump = true })
|
||||
else
|
||||
local ok, err = pcall(vim.cmd.cnext)
|
||||
if not ok then
|
||||
vim.notify(err, vim.log.levels.ERROR)
|
||||
end
|
||||
end
|
||||
end,
|
||||
desc = "Next trouble/quickfix item",
|
||||
{ "<leader>bp", "<Cmd>BufferLineTogglePin<CR>", desc = "Toggle buffer-pin" },
|
||||
{ "<leader>xo", "<Cmd>BufferLineCloseOthers<CR>", desc = "Delete other buffers" },
|
||||
},
|
||||
opts = {
|
||||
options = {
|
||||
close_command = function(n) require("mini.bufremove").delete(n, false) end,
|
||||
right_mouse_command = function(n) require("mini.bufremove").delete(n, false) end,
|
||||
diagnostics = "nvim_lsp",
|
||||
always_show_bufferline = false,
|
||||
offsets = {
|
||||
{
|
||||
filetype = "neo-tree",
|
||||
text = "Neo-tree",
|
||||
highlight = "Directory",
|
||||
text_align = "left",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Finds and lists all of the TODO, HACK, BUG, etc comment
|
||||
{
|
||||
"folke/todo-comments.nvim",
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "]t", function() require("todo-comments").jump_next() end, desc = "Next todo comment" },
|
||||
{ "[t", function() require("todo-comments").jump_prev() end, desc = "Previous todo comment" },
|
||||
{ "<leader>xt", "<cmd>TodoTrouble<cr>", desc = "Todo (Trouble)" },
|
||||
{ "<leader>xT", "<cmd>TodoTrouble keywords=TODO,FIX,FIXME<cr>", desc = "Todo/Fix/Fixme (Trouble)" },
|
||||
{ "<leader>st", "<cmd>TodoTelescope<cr>", desc = "Todo" },
|
||||
{ "<leader>sT", "<cmd>TodoTelescope keywords=TODO,FIX,FIXME<cr>", desc = "Todo/Fix/Fixme" },
|
||||
},
|
||||
config = function(_, opts)
|
||||
require("bufferline").setup(opts)
|
||||
-- Fix bufferline when restoring a session
|
||||
vim.api.nvim_create_autocmd("BufAdd", {
|
||||
callback = function()
|
||||
vim.schedule(function()
|
||||
pcall(nvim_bufferline)
|
||||
end)
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- UI Stuff ------------------------------------------------------------------------
|
||||
|
||||
-- Fancy-looking tabs, which include filetype icons and close buttons.
|
||||
{ "akinsho/bufferline.nvim" },
|
||||
-- icons
|
||||
{ "nvim-tree/nvim-web-devicons" },
|
||||
|
||||
-- Fancy Statusline
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
opts = function()
|
||||
local lualine_require = require("lualine_require")
|
||||
lualine_require.require = require
|
||||
|
||||
local icons = require("lazyvim.config").icons
|
||||
|
||||
vim.o.laststatus = vim.g.lualine_laststatus
|
||||
|
||||
return {
|
||||
options = {
|
||||
theme = "auto",
|
||||
globalstatus = true,
|
||||
disabled_filetypes = { statusline = { "dashboard", "alpha", "starter" } },
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = { "branch" },
|
||||
|
||||
lualine_c = {
|
||||
Util.lualine.root_dir(),
|
||||
{
|
||||
"diagnostics",
|
||||
symbols = {
|
||||
error = icons.diagnostics.Error,
|
||||
warn = icons.diagnostics.Warn,
|
||||
info = icons.diagnostics.Info,
|
||||
hint = icons.diagnostics.Hint,
|
||||
},
|
||||
},
|
||||
{ "filetype", icon_only = true, separator = "", padding = { left = 1, right = 0 } },
|
||||
{ Util.lualine.pretty_path() },
|
||||
},
|
||||
lualine_x = {
|
||||
-- stylua: ignore
|
||||
{
|
||||
function() return require("noice").api.status.command.get() end,
|
||||
cond = function() return package.loaded["noice"] and require("noice").api.status.command.has() end,
|
||||
color = Util.ui.fg("Statement"),
|
||||
},
|
||||
-- stylua: ignore
|
||||
{
|
||||
function() return require("noice").api.status.mode.get() end,
|
||||
cond = function() return package.loaded["noice"] and require("noice").api.status.mode.has() end,
|
||||
color = Util.ui.fg("Constant"),
|
||||
},
|
||||
-- stylua: ignore
|
||||
{
|
||||
function() return " " .. require("dap").status() end,
|
||||
cond = function () return package.loaded["dap"] and require("dap").status() ~= "" end,
|
||||
color = Util.ui.fg("Debug"),
|
||||
},
|
||||
{
|
||||
require("lazy.status").updates,
|
||||
cond = require("lazy.status").has_updates,
|
||||
color = Util.ui.fg("Special"),
|
||||
},
|
||||
{
|
||||
"diff",
|
||||
symbols = {
|
||||
added = icons.git.added,
|
||||
modified = icons.git.modified,
|
||||
removed = icons.git.removed,
|
||||
},
|
||||
source = function()
|
||||
local gitsigns = vim.b.gitsigns_status_dict
|
||||
if gitsigns then
|
||||
return {
|
||||
added = gitsigns.added,
|
||||
modified = gitsigns.changed,
|
||||
removed = gitsigns.removed,
|
||||
}
|
||||
end
|
||||
end,
|
||||
},
|
||||
},
|
||||
lualine_y = {},
|
||||
lualine_z = { { "progress" }, { "location" } },
|
||||
},
|
||||
extensions = { "neo-tree", "lazy" },
|
||||
}
|
||||
end,
|
||||
},
|
||||
-- ui components
|
||||
{ "MunifTanjim/nui.nvim" },
|
||||
|
||||
-- Better vim.ui
|
||||
{ "stevearc/dressing.nvim" },
|
||||
@@ -429,7 +152,7 @@ return {
|
||||
"rcarriga/nvim-notify",
|
||||
keys = {
|
||||
{
|
||||
"<leader>un",
|
||||
"<leader>xn",
|
||||
function()
|
||||
require("notify").dismiss({ silent = true, pending = true })
|
||||
end,
|
||||
@@ -454,13 +177,29 @@ return {
|
||||
-- Completely replaces the UI for messages, cmdline and the popupmenu.
|
||||
{
|
||||
"folke/noice.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"MunifTanjim/nui.nvim",
|
||||
"rcarriga/nvim-notify",
|
||||
},
|
||||
opts = {
|
||||
lsp = {
|
||||
override = {
|
||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||
["vim.lsp.util.stylize_markdown"] = true,
|
||||
["cmp.entry.get_documentation"] = true,
|
||||
},
|
||||
},
|
||||
routes = {
|
||||
{
|
||||
-- Show popup message when @recording macros
|
||||
view = "notify",
|
||||
filter = { event = "msg_showmode" },
|
||||
},
|
||||
{
|
||||
filter = { event = "notify", find = "No information available" },
|
||||
opts = { skin = true },
|
||||
},
|
||||
{
|
||||
-- Direct some messages to bottom - obove lualine
|
||||
view = "mini",
|
||||
@@ -483,67 +222,43 @@ return {
|
||||
},
|
||||
},
|
||||
},
|
||||
-- TODO: Some messages needs to suppressed completely. Figure out how???
|
||||
},
|
||||
presets = {
|
||||
lsp_doc_border = true,
|
||||
bottom_search = true,
|
||||
command_palette = true,
|
||||
long_message_to_split = true,
|
||||
inc_rename = true,
|
||||
},
|
||||
},
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<S-Enter>", function() require("noice").redirect(vim.fn.getcmdline()) end, mode = "c", desc = "Redirect Cmdline" },
|
||||
{ "<leader>snl", function() require("noice").cmd("last") end, desc = "Noice Last Message" },
|
||||
{ "<leader>snh", function() require("noice").cmd("history") end, desc = "Noice History" },
|
||||
{ "<leader>sna", function() require("noice").cmd("all") end, desc = "Noice All" },
|
||||
{ "<leader>snd", function() require("noice").cmd("dismiss") end, desc = "Dismiss All" },
|
||||
{ "<c-f>", function() if not require("noice.lsp").scroll(4) then return "<c-f>" end end, silent = true, expr = true, desc = "Scroll forward", mode = {"i", "n", "s"} },
|
||||
{ "<c-b>", function() if not require("noice.lsp").scroll(-4) then return "<c-b>" end end, silent = true, expr = true, desc = "Scroll backward", mode = {"i", "n", "s"}},
|
||||
{ "<leader>nx", "<cmd>NoiceDismiss<CR>", desc = "Dismiss all [N]oice notifications" },
|
||||
-- TODO: Find better keymaps
|
||||
-- { "<S-Enter>", function() require("noice").redirect(vim.fn.getcmdline()) end, mode = "c", desc = "Redirect Cmdline" },
|
||||
-- { "<leader>snl", function() require("noice").cmd("last") end, desc = "Noice Last Message" },
|
||||
-- { "<leader>snh", function() require("noice").cmd("history") end, desc = "Noice History" },
|
||||
-- { "<leader>sna", function() require("noice").cmd("all") end, desc = "Noice All" },
|
||||
-- { "<leader>snd", function() require("noice").cmd("dismiss") end, desc = "Dismiss All" },
|
||||
-- { "<leader>snd", function() require("noice").cmd("dismiss") end, desc = "Dismiss All" },
|
||||
-- { "<c-f>", function() if not require("noice.lsp").scroll(4) then return "<c-f>" end end, silent = true, expr = true, desc = "Scroll forward", mode = { "i", "n", "s" } },
|
||||
-- { "<c-b>", function() if not require("noice.lsp").scroll(-4) then return "<c-b>" end end, silent = true, expr = true, desc = "Scroll backward", mode = { "i", "n", "s" } },
|
||||
},
|
||||
},
|
||||
|
||||
-- ui components
|
||||
{ "MunifTanjim/nui.nvim" },
|
||||
|
||||
{ "goolord/alpha-nvim", enabled = false },
|
||||
-- Set lualine as statusline
|
||||
{
|
||||
"akinsho/toggleterm.nvim",
|
||||
cmd = "ToggleTerm",
|
||||
build = ":ToggleTerm",
|
||||
keys = {
|
||||
-- NOTE: Do not use <leader> for terminals, there would be issue escaping
|
||||
-- F13 = Shift + F1
|
||||
{ "<F13>", "<cmd>ToggleTerm direction=horizontal<cr>", desc = "Toggle horizontal terminal" },
|
||||
},
|
||||
"nvim-lualine/lualine.nvim",
|
||||
-- See `:help lualine.txt`
|
||||
opts = {
|
||||
open_mapping = [[<F13>]],
|
||||
direction = "horizontal",
|
||||
shade_filetypes = {},
|
||||
hide_numbers = true,
|
||||
insert_mappings = true,
|
||||
terminal_mappings = true,
|
||||
start_in_insert = true,
|
||||
close_on_exit = true,
|
||||
float_opts = {
|
||||
border = "curved",
|
||||
-- TODO: Need the following:
|
||||
-- - Remove encoding & OS
|
||||
-- - Add Breadcrumb
|
||||
-- - Show command that was typed
|
||||
options = {
|
||||
icons_enabled = false,
|
||||
component_separators = "|",
|
||||
section_separators = "",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"mikesmithgh/kitty-scrollback.nvim",
|
||||
lazy = true,
|
||||
cmd = { "KittyScrollbackGenerateKittens", "KittyScrollbackCheckHealth" },
|
||||
event = { "User KittyScrollbackLaunch" },
|
||||
version = "^3.0.0",
|
||||
opts = {
|
||||
status_window = {
|
||||
icons = { nvim = "" },
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
require("kitty-scrollback").setup()
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
keys = {
|
||||
{
|
||||
"<leader>cF",
|
||||
function()
|
||||
require("conform").format({ formatters = { "injected" } })
|
||||
end,
|
||||
mode = { "n", "v" },
|
||||
desc = "Format Injected Langs",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
3
common/.config/nvim/lua/plugins/init.lua
Normal file
3
common/.config/nvim/lua/plugins/init.lua
Normal file
@@ -0,0 +1,3 @@
|
||||
return {
|
||||
-- NOTE: Placeholder for new plugins I'm trying out
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
opts = {
|
||||
linters_by_ft = {
|
||||
text = { "vale" },
|
||||
json = { "jsonlint" },
|
||||
markdown = { "markdownlint", "vale" },
|
||||
rst = { "vale" },
|
||||
dockerfile = { "hadolint" },
|
||||
go = { "golangcilint" },
|
||||
jq = { "jq" },
|
||||
bash = { "shellcheck" },
|
||||
shell = { "shellcheck" },
|
||||
yaml = { "yamllint" },
|
||||
zsh = { "zsh" },
|
||||
typescript = { "eslint_d" },
|
||||
javascript = { "eslint_d" },
|
||||
-- Use the "*" filetype to run linters on all filetypes.
|
||||
-- ['*'] = { 'global linter' },
|
||||
-- Use the "_" filetype to run linters on filetypes that don't have other linters configured.
|
||||
-- ['_'] = { 'fallback linter' },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
119
common/.config/nvim/lua/plugins/telescope.lua
Normal file
119
common/.config/nvim/lua/plugins/telescope.lua
Normal file
@@ -0,0 +1,119 @@
|
||||
return {
|
||||
-- Fuzzy Finder (files, lsp, etc)
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
branch = "0.1.x",
|
||||
lazy = false,
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
{
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
build = "make",
|
||||
cond = function()
|
||||
return vim.fn.executable("make") == 1
|
||||
end,
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
-- NOTE: Search in hidden files trick taken from: https://stackoverflow.com/a/75500661/11057673
|
||||
local telescopeConfig = require("telescope.config")
|
||||
|
||||
-- Clone the default Telescope configuration
|
||||
local vimgrep_arguments = { unpack(telescopeConfig.values.vimgrep_arguments) }
|
||||
|
||||
-- Add flag to search hidden files/folders
|
||||
table.insert(vimgrep_arguments, "--hidden")
|
||||
table.insert(vimgrep_arguments, "--glob")
|
||||
-- And to ignore .git directory. Needed since its not `.gitignore`d
|
||||
table.insert(vimgrep_arguments, "!**/.git/*")
|
||||
|
||||
require("telescope").setup({
|
||||
defaults = {
|
||||
-- `hidden = true` is not supported in text grep commands.
|
||||
hidden = true,
|
||||
-- Without this live_grep would show .git entries
|
||||
vimgrep_arguments = vimgrep_arguments,
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-u>"] = false,
|
||||
["<C-d>"] = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
pickers = {
|
||||
colorscheme = { enable_preview = true },
|
||||
find_files = {
|
||||
hidden = true,
|
||||
-- Redoing the vimgrep_arguments changes for find_files as well
|
||||
find_command = { "rg", "--files", "--hidden", "--glob", "!**/.git/*" },
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Load some required Telescope extensions
|
||||
pcall(require("telescope").load_extension, "fzf")
|
||||
pcall(require("telescope").load_extension, "noice")
|
||||
pcall(require("telescope").load_extension, "undo")
|
||||
|
||||
-- Special Things: [T]elescope
|
||||
vim.keymap.set("n", "<leader>tr", require("telescope.builtin").resume,
|
||||
{ desc = "[T]elescope [R]esume Last Search" })
|
||||
vim.keymap.set("n", "<leader>tc", require("telescope.builtin").colorscheme,
|
||||
{ desc = "List Colorschemes (with preview)" })
|
||||
|
||||
-- Grep things -> [S]earch
|
||||
vim.keymap.set("n", "<leader>sb", function()
|
||||
require("telescope.builtin").live_grep({
|
||||
grep_open_files = true,
|
||||
prompt_title = "Live Grep in Open Files",
|
||||
})
|
||||
end, { desc = "[S]earch Open [B]uffers" })
|
||||
vim.keymap.set("n", "<leader>sg", require("telescope.builtin").live_grep,
|
||||
{ desc = "[S]earch/Live[G]rep the Project" })
|
||||
vim.keymap.set("n", "<leader>sw", require("telescope.builtin").grep_string,
|
||||
{ desc = "[S]earch current [W]ord in Project" })
|
||||
|
||||
-- [L]ist
|
||||
vim.keymap.set("n", "<leader>lb", require("telescope.builtin").buffers, { desc = "[L]ist [B]uffers" })
|
||||
vim.keymap.set("n", "<leader>lc", require("telescope.builtin").command_history,
|
||||
{ desc = "[L]ist NeoVIM [C]ommand History" })
|
||||
vim.keymap.set("n", "<leader>lf", require("telescope.builtin").find_files,
|
||||
{ desc = "[L]ist & Search [F]iles" })
|
||||
vim.keymap.set("n", "<leader>lh", require("telescope.builtin").help_tags,
|
||||
{ desc = "[L]ist & Search NeoVIM [H]elp" })
|
||||
vim.keymap.set("n", "<leader>lk", require("telescope.builtin").keymaps,
|
||||
{ desc = "[L]ist & Search NeoVIM [K]eymaps" })
|
||||
vim.keymap.set("n", "<leader>lm", require("telescope.builtin").marks, { desc = "[L]ist [M]arks" })
|
||||
vim.keymap.set("n", "<leader>ln", require("telescope.builtin").man_pages,
|
||||
{ desc = "[L]ist & Search System Ma[n] Pages" })
|
||||
vim.keymap.set("n", "<leader>lq", require("telescope.builtin").quickfixhistory,
|
||||
{ desc = "[L]ist [Q]uickfix History" })
|
||||
vim.keymap.set("n", "<leader>ls", require("telescope.builtin").search_history,
|
||||
{ desc = "[L]ist [S]earch History" })
|
||||
vim.keymap.set("n", "<leader>lv", require("telescope.builtin").vim_options, { desc = "[L]ist [V]im Options" })
|
||||
|
||||
-- Git things -> [G]it
|
||||
vim.keymap.set("n", "<leader>gb", require("telescope.builtin").git_branches,
|
||||
{ desc = "List [G]it [B]ranches" })
|
||||
vim.keymap.set("n", "<leader>gc", require("telescope.builtin").git_commits, { desc = "List [G]it [C]ommits" })
|
||||
|
||||
-- LSP Things -> [C]oding
|
||||
vim.keymap.set("n", "<leader>cd", require("telescope.builtin").diagnostics,
|
||||
{ desc = "[C]ode: List [D]iagnostics" })
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>ci",
|
||||
require("telescope.builtin").lsp_implementations,
|
||||
{ desc = "[C]ode: Goto [I]mplementation of the word under cursor" }
|
||||
)
|
||||
vim.keymap.set("n", "<leader>cr", require("telescope.builtin").lsp_references,
|
||||
{ desc = "[C]ode: List [R]eferences for word under cursor" })
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<leader>ct",
|
||||
require("telescope.builtin").lsp_type_definitions,
|
||||
{ desc = "[C]ode: Goto definition of the [T]ype under cursor" }
|
||||
)
|
||||
end,
|
||||
},
|
||||
}
|
||||
129
common/.config/nvim/lua/plugins/treesitter.lua
Normal file
129
common/.config/nvim/lua/plugins/treesitter.lua
Normal file
@@ -0,0 +1,129 @@
|
||||
return {
|
||||
{
|
||||
-- nvim-treesitter provides parsers for individual languages
|
||||
-- Output of these parses are fed to the NVIM's native treesitter(vim.treesitter)
|
||||
-- What is fed to the native treesitter is essentially the AST
|
||||
-- This AST is then used for syntax-highlighting and many other operations on the code
|
||||
-- Hence, this plugin is only to make installing parsers easier
|
||||
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
lazy = false,
|
||||
build = ":TSUpdate",
|
||||
init = function(plugin)
|
||||
-- PERF: add nvim-treesitter queries to the rtp and it's custom query predicates early
|
||||
-- This is needed because a bunch of plugins no longer `require("nvim-treesitter")`, which
|
||||
-- no longer trigger the **nvim-treeitter** module to be loaded in time.
|
||||
-- Luckily, the only thing that those plugins need are the custom queries, which we make available
|
||||
-- during startup.
|
||||
require("lazy.core.loader").add_to_rtp(plugin)
|
||||
require("nvim-treesitter.query_predicates")
|
||||
end,
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
config = function()
|
||||
-- When in diff mode, we want to use the default
|
||||
-- vim text objects c & C instead of the treesitter ones.
|
||||
local move = require("nvim-treesitter.textobjects.move") ---@type table<string,fun(...)>
|
||||
local configs = require("nvim-treesitter.configs")
|
||||
for name, fn in pairs(move) do
|
||||
if name:find("goto") == 1 then
|
||||
move[name] = function(q, ...)
|
||||
if vim.wo.diff then
|
||||
local config = configs.get_module("textobjects.move")
|
||||
[name] ---@type table<string,string>
|
||||
for key, query in pairs(config or {}) do
|
||||
if q == query and key:find("[%]%[][cC]") then
|
||||
vim.cmd("normal! " .. key)
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
return fn(q, ...)
|
||||
end
|
||||
end
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
config = function()
|
||||
-- See `:help nvim-treesitter`
|
||||
-- Defer Treesitter setup after first render to improve startup time of 'nvim {filename}'
|
||||
vim.defer_fn(function()
|
||||
require("nvim-treesitter.configs").setup({
|
||||
ensure_installed = {
|
||||
-- These 2 are required for cmdline
|
||||
"regex",
|
||||
"markdown_inline",
|
||||
},
|
||||
|
||||
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>",
|
||||
},
|
||||
},
|
||||
|
||||
textobjects = {
|
||||
|
||||
select = {
|
||||
enable = true,
|
||||
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
|
||||
keymaps = {
|
||||
-- You can use the capture groups defined in textobjects.scm (:TSEditQuery textobjects)
|
||||
["aa"] = { query = "@parameter.outer", desc = "Select around the parameter" },
|
||||
["ia"] = { query = "@parameter.inner", desc = "Select inside the parameter" },
|
||||
["af"] = { query = "@function.outer", desc = "Select around the function" },
|
||||
["if"] = { query = "@function.inner", desc = "Select inside of the function" },
|
||||
["ac"] = { query = "@class.outer", desc = "Select around the class" },
|
||||
["ic"] = { query = "@class.inner", desc = "Select inside of the class" },
|
||||
|
||||
["al"] = { query = "@loop.outer", desc = "Select around the loop" },
|
||||
["il"] = { query = "@loop.inner", desc = "Select inside of the loop" },
|
||||
["as"] = { query = "@scope", query_group = "locals", desc = "Select around the scope" },
|
||||
},
|
||||
},
|
||||
|
||||
move = {
|
||||
-- Jump to next and previous text objects
|
||||
enable = true,
|
||||
goto_next_start = {
|
||||
["]f"] = { query = "@function.outer", desc = "Goto next inner function start" },
|
||||
["]c"] = { query = "@class.outer", desc = "Goto next inner class start" },
|
||||
},
|
||||
goto_next_end = {
|
||||
["]F"] = { query = "@function.outer", desc = "Goto next outer function end" },
|
||||
["]C"] = { query = "@class.outer", desc = "Goto next outer class end" },
|
||||
},
|
||||
goto_previous_start = {
|
||||
["[f"] = { query = "@function.outer", desc = "Goto goto previous inner function start" },
|
||||
["[c"] = { query = "@class.outer", desc = "Previous inner class start" },
|
||||
},
|
||||
goto_previous_end = {
|
||||
["[F"] = { query = "@function.outer", desc = "Goto goto previous outer function start" },
|
||||
["[C"] = { query = "@class.outer", desc = "Goto previous outer class start" },
|
||||
},
|
||||
},
|
||||
|
||||
lsp_interop = {
|
||||
enable = true,
|
||||
border = "none",
|
||||
floating_preview_opts = {},
|
||||
peek_definition_code = {
|
||||
-- TIP: Press the shortcut 2 times to enter the floating window
|
||||
["<leader>df"] = { query = "@function.outer", desc = "Peek function definition on a popup" },
|
||||
["<leader>dF"] = { query = "@class.outer", desc = "Peek class definition on a popup" },
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end, 0)
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
return {
|
||||
-- Don't measure startuptime
|
||||
{ "dstein64/vim-startuptime", enabled = false },
|
||||
|
||||
-- Session management.
|
||||
{
|
||||
"folke/persistence.nvim",
|
||||
opts = {
|
||||
dir = vim.fn.expand(vim.fn.stdpath("config") .. "/sessions/"),
|
||||
},
|
||||
},
|
||||
}
|
||||
62
common/.config/nvim/lua/plugins/utility-plugs.lua
Normal file
62
common/.config/nvim/lua/plugins/utility-plugs.lua
Normal file
@@ -0,0 +1,62 @@
|
||||
return {
|
||||
-- Navigate between NVIM & Tmux splits seamlessly
|
||||
{ "christoomey/vim-tmux-navigator" },
|
||||
|
||||
-- Open Kitty terminal scrollback as buffer
|
||||
{
|
||||
"mikesmithgh/kitty-scrollback.nvim",
|
||||
lazy = true,
|
||||
cmd = { "KittyScrollbackGenerateKittens", "KittyScrollbackCheckHealth" },
|
||||
event = { "User KittyScrollbackLaunch" },
|
||||
version = "^3.0.0",
|
||||
opts = {
|
||||
status_window = {
|
||||
icons = { nvim = "" },
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
require("kitty-scrollback").setup()
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
config = function()
|
||||
-- document existing key chains
|
||||
require("which-key").register({
|
||||
["<leader>e"] = { name = "[E]xplorer", _ = "which_key_ignore" },
|
||||
["<leader>c"] = { name = "[C]ode", _ = "which_key_ignore" },
|
||||
["<leader>d"] = { name = "[D]ocument", _ = "which_key_ignore" },
|
||||
["<leader>g"] = { name = "[G]it", _ = "which_key_ignore" },
|
||||
["<leader>h"] = { name = "Git [H]unk", _ = "which_key_ignore" },
|
||||
["<leader>r"] = { name = "[R]ename", _ = "which_key_ignore" },
|
||||
["<leader>s"] = { name = "[S]earch", _ = "which_key_ignore" },
|
||||
["<leader>t"] = { name = "[T]oggle", _ = "which_key_ignore" },
|
||||
["<leader>w"] = { name = "[W]orkspace", _ = "which_key_ignore" },
|
||||
})
|
||||
-- register which-key VISUAL mode
|
||||
-- required for visual <leader>hs (hunk stage) to work
|
||||
require("which-key").register({
|
||||
["<leader>"] = { name = "VISUAL <leader>" },
|
||||
["<leader>h"] = { "Git [H]unk" },
|
||||
}, { mode = "v" })
|
||||
end,
|
||||
},
|
||||
|
||||
-- Session management. This saves your session in the background,
|
||||
-- keeping track of open buffers, window arrangement, and more.
|
||||
-- You can restore sessions when returning through the dashboard.
|
||||
{
|
||||
-- TODO:
|
||||
-- 1. Find out where they are stored exactly.
|
||||
-- 2. Add them to source control
|
||||
-- 3. Need a startup dashboard with options for loading last session
|
||||
"folke/persistence.nvim",
|
||||
event = "BufReadPre",
|
||||
opts = { options = vim.opt.sessionoptions:get() },
|
||||
keys = {
|
||||
{ "<leader>sr", function() require("persistence").load() end, desc = "[R]estore [S]ession" },
|
||||
{ "<leader>sl", function() require("persistence").load({ last = true }) end, desc = "[R]estore [L]ast Session" },
|
||||
},
|
||||
},
|
||||
}
|
||||
Submodule common/.config/nvim_switch/nvchad deleted from b22c7b37c3
@@ -1,32 +0,0 @@
|
||||
-- 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
|
||||
|
||||
-- Setup Lazy.nvim package manager
|
||||
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(lazypath)
|
||||
|
||||
require("lazy").setup("plugins", {
|
||||
change_detection = {
|
||||
enabled = true,
|
||||
notify = false,
|
||||
},
|
||||
})
|
||||
|
||||
require("configs.autocommands")
|
||||
require("configs.configs")
|
||||
require("configs.keymaps")
|
||||
@@ -1,9 +0,0 @@
|
||||
-- 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 = '*',
|
||||
})
|
||||
@@ -1,8 +0,0 @@
|
||||
-- Load configs from VIM
|
||||
local vim_configs = os.getenv("HOME") .. "/.vim/configs.vim"
|
||||
if vim.loop.fs_stat(vim_configs) then
|
||||
vim.cmd("source " .. vim_configs)
|
||||
end
|
||||
|
||||
vim.opt.undodir = vim.fn.stdpath("config") .. "/undo"
|
||||
vim.opt.backupdir = vim.fn.stdpath("config") .. "/backup/"
|
||||
@@ -1,11 +0,0 @@
|
||||
-- Load Keybindings from VIM
|
||||
local vim_mappings = os.getenv("HOME") .. "/.vim/key_maps.vim"
|
||||
if vim.loop.fs_stat(vim_mappings) then
|
||||
vim.cmd("source " .. vim_mappings)
|
||||
end
|
||||
|
||||
-- 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 })
|
||||
|
||||
-- map <leader>j <Plug>(easymotion-s)
|
||||
@@ -1,14 +0,0 @@
|
||||
-- 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" },
|
||||
{ "rstacruz/vim-closer" },
|
||||
{ "airblade/vim-gitgutter" },
|
||||
{ "easymotion/vim-easymotion" },
|
||||
{ "tpope/vim-obsession" },
|
||||
{ "mg979/vim-visual-multi" },
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
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
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
config = function ()
|
||||
require("trouble").setup({})
|
||||
end
|
||||
},
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
local tree_config = require("nvim-treesitter.configs")
|
||||
tree_config.setup({
|
||||
auto_install = true,
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<C-space>",
|
||||
node_incremental = "<C-space>",
|
||||
scope_incremental = "<C-CR>",
|
||||
node_decremental = "<bs>",
|
||||
}
|
||||
}
|
||||
})
|
||||
end
|
||||
},
|
||||
{
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
main = "ibl",
|
||||
config = function()
|
||||
require("ibl").setup({
|
||||
indent = { char = "┆" },
|
||||
})
|
||||
end
|
||||
},
|
||||
-- { "windwp/nvim-autopairs" },
|
||||
-- {
|
||||
-- "akinsho/toggleterm.nvim",
|
||||
-- version = "*",
|
||||
-- config = function ()
|
||||
-- require("toggleterm").setup({})
|
||||
-- end
|
||||
-- },
|
||||
}
|
||||
@@ -1,123 +0,0 @@
|
||||
-- TODO: Autocompletion is a hit and miss. Way too complicated at this point
|
||||
-- TODO: Try doing LazyVim.nvim instead
|
||||
|
||||
-- TODO: Use nvim-lint for linting - newer thing
|
||||
|
||||
return {
|
||||
-- LSP Configuration
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
lazy = false,
|
||||
config = function()
|
||||
-- local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
|
||||
-- local lspconfig = require("lspconfig")
|
||||
-- lspconfig.tsserver.setup({
|
||||
-- capabilities = capabilities,
|
||||
-- })
|
||||
-- lspconfig.html.setup({
|
||||
-- capabilities = capabilities,
|
||||
-- })
|
||||
-- lspconfig.lua_ls.setup({
|
||||
-- capabilities = capabilities,
|
||||
-- })
|
||||
end
|
||||
},
|
||||
{
|
||||
-- Provides :Mason command which installs Language Servers
|
||||
"williamboman/mason.nvim",
|
||||
lazy = false,
|
||||
config = function()
|
||||
require("mason").setup()
|
||||
end
|
||||
},
|
||||
{
|
||||
-- Helps to auto install Language Servers by specifying them
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
lazy = false,
|
||||
opts = {
|
||||
auto_install = true,
|
||||
},
|
||||
config = function()
|
||||
require("mason-lspconfig").setup({})
|
||||
end
|
||||
},
|
||||
{
|
||||
-- Spawns linters, parses their outputs & reports results via nvim.diagnostic
|
||||
"mfussenegger/nvim-lint",
|
||||
event = {
|
||||
"BufReadPre",
|
||||
"BufNewFile"
|
||||
},
|
||||
config = function()
|
||||
local lint = require("lint")
|
||||
local linters = require("lint").linters
|
||||
local linterConfig = vim.fn.stdpath("config") .. "linter_configs"
|
||||
|
||||
lint.linters_by_ft = {
|
||||
json = { "jsonlint" },
|
||||
protobuf = { "buf", "codespell" },
|
||||
|
||||
text = { "vale" },
|
||||
markdown = { "vale", "markdownlint" },
|
||||
rst = { "vale" },
|
||||
|
||||
html = { "markuplint", "htmlhint" },
|
||||
|
||||
bash = { "shellcheck", "codespell" },
|
||||
shell = { "shellcheck", "codespell" },
|
||||
lua = { "compiler", "selene", "codespell" },
|
||||
luau = { "compiler", "selene", "codespell" },
|
||||
|
||||
javascript = { "eslint_d", "codespell" },
|
||||
typescript = { "eslint_d", "codespell" },
|
||||
javascriptreact = { "eslint_d", "codespell" },
|
||||
typescriptreact = { "eslint_d", "codespell" },
|
||||
|
||||
python = { "pyre", "codespell" },
|
||||
}
|
||||
|
||||
-- use for codespell for all except css
|
||||
for ft, _ in pairs(lint.linters_by_ft) do
|
||||
if ft ~= "css" then table.insert(lint.linters_by_ft[ft], "codespell") end
|
||||
end
|
||||
|
||||
linters.codespell.args = {
|
||||
"--ignore-words",
|
||||
linterConfig .. "/codespell-ignore.txt",
|
||||
"--builtin=pratik,kumar,tripathy",
|
||||
}
|
||||
|
||||
linters.shellcheck.args = {
|
||||
"--shell=bash", -- force to work with zsh
|
||||
"--format=json",
|
||||
"-",
|
||||
}
|
||||
|
||||
linters.yamllint.args = {
|
||||
"--config-file",
|
||||
linterConfig .. "/yamllint.yaml",
|
||||
"--format=parsable",
|
||||
"-",
|
||||
}
|
||||
|
||||
linters.markdownlint.args = {
|
||||
"--disable=no-trailing-spaces", -- not disabled in config, so it's enabled for formatting
|
||||
"--disable=no-multiple-blanks",
|
||||
"--config=" .. linterConfig .. "/markdownlint.yaml",
|
||||
}
|
||||
|
||||
local lint_group = vim.api.nvim_create_augroup("lint", { clear = true })
|
||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
||||
group = lint_group,
|
||||
callback = function ()
|
||||
lint.try_lint()
|
||||
end,
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<leader>ll", function ()
|
||||
lint.try_lint()
|
||||
end, { desc = "Lint current file" })
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"theprimeagen/refactoring.nvim"
|
||||
},
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"rebelot/kanagawa.nvim",
|
||||
name = "kanagawa",
|
||||
priority = 1000,
|
||||
lazy = false,
|
||||
config = function()
|
||||
vim.cmd.colorscheme "kanagawa-wave"
|
||||
end
|
||||
},
|
||||
{
|
||||
"catppuccin/nvim",
|
||||
name = "catppuccin",
|
||||
priority = 1000,
|
||||
config = function()
|
||||
require("catppuccin").setup({
|
||||
show_end_of_buffer = true,
|
||||
integrations = {
|
||||
cmp = true,
|
||||
gitsigns = true,
|
||||
nvimtree = true,
|
||||
},
|
||||
})
|
||||
-- vim.cmd.colorscheme "catppuccin-mocha"
|
||||
end
|
||||
},
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
return {
|
||||
"nvim-lualine/lualine.nvim",
|
||||
config = function()
|
||||
local lazy_status = require("lazy.status")
|
||||
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
-- theme = "horizon",
|
||||
-- TODO: Following ain't taking effect. Why?
|
||||
sections = {
|
||||
lualine_a = {'mode','filename'},
|
||||
lualine_b = {'branch'},
|
||||
lualine_c = {'diff', 'diagnostics'},
|
||||
lualine_x = { { lazy_status.updates, cond = lazy_status.has_updates } },
|
||||
lualine_y = {'progress'},
|
||||
lualine_z = {'location', 'searchcount'}
|
||||
},
|
||||
}
|
||||
})
|
||||
end
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"airblade/vim-rooter",
|
||||
config = function()
|
||||
vim.g.rooter_cd_cmd = "tcd"
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
config = function()
|
||||
require("neo-tree").setup({
|
||||
filesystem = {
|
||||
follow_current_file = {
|
||||
enabled = true, -- Highlight the current buffer
|
||||
leave_dirs_open = true,
|
||||
},
|
||||
use_libuv_file_watcher = true, -- Sync file system changes
|
||||
filtered_items = {
|
||||
visible = true,
|
||||
show_hidden_count = true,
|
||||
hide_dotfile = false,
|
||||
hide_gitignore = false,
|
||||
},
|
||||
},
|
||||
window = {
|
||||
position = "left",
|
||||
width = 25, -- Saner window size
|
||||
mappings = {
|
||||
["s"] = "open_split", -- Default vim keymap for horizontal split
|
||||
["v"] = "open_vsplit", -- Default vim keymap for vertical split
|
||||
},
|
||||
},
|
||||
default_component_configs = {
|
||||
indent = {
|
||||
indent_size = 1, -- Compact tree display
|
||||
padding = 0, -- Compact tree display
|
||||
},
|
||||
},
|
||||
})
|
||||
-- Keymaps for Neotree
|
||||
vim.keymap.set("n", "<Leader>e", ":Neotree filesystem toggle<CR>")
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
return {
|
||||
{
|
||||
"nvim-telescope/telescope.nvim", tag = "0.1.5",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"neovim/nvim-lspconfig",
|
||||
"nvim-tree/nvim-web-devicons"
|
||||
},
|
||||
config = function()
|
||||
local actions = require("telescope.actions")
|
||||
|
||||
require("telescope").setup({
|
||||
pickers = {
|
||||
find_files = {
|
||||
mappings = {
|
||||
i = {
|
||||
-- Ctrl + s to open in horizontal split
|
||||
["<C-s>"] = actions.select_horizontal
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
require("telescope").load_extension("fzf")
|
||||
|
||||
-- Keymaps for Telescope
|
||||
local builtin = require("telescope.builtin")
|
||||
vim.keymap.set("n", "<leader>ff", "<cmd>lua require'telescope.builtin'.find_files({ find_command = {'rg', '--files', '--hidden', '-g', '!{**/.git/*,**/node_modules/*,**/package-lock.json,**/yarn.lock}' }})<cr>", {})
|
||||
-- TODO: Live grep ain't working
|
||||
-- vim.keymap.set("n", "<Leader>fl", builtin.live_grep, {})
|
||||
vim.keymap.set("n", "<Leader>fm", builtin.marks, {})
|
||||
vim.keymap.set("n", "<Leader>fc", builtin.colorscheme, {})
|
||||
vim.keymap.set("n", "<Leader>fr", builtin.registers, {})
|
||||
vim.keymap.set("n", "<Leader>fs", builtin.lsp_document_symbols, {})
|
||||
vim.keymap.set("n", "<Leader>fw", builtin.grep_string, {})
|
||||
vim.keymap.set("n", "<Leader>fg", "<cmd>AdvancedGitSearch<CR>", {})
|
||||
vim.keymap.set("n", "<Leader>ft", builtin.treesitter, {})
|
||||
-- TODO: Find TODO ain't working either
|
||||
vim.keymap.set("n", "<Leader>fd", ":TodoTelescope<CR>", {})
|
||||
end
|
||||
},
|
||||
{
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build'
|
||||
},
|
||||
{
|
||||
-- For displaying LSP Code Actions
|
||||
"nvim-telescope/telescope-ui-select.nvim",
|
||||
config = function()
|
||||
require("telescope").setup({
|
||||
extensions = {
|
||||
["ui-select"] = {
|
||||
require("telescope.themes").get_dropdown{
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
require("telescope").load_extension("ui-select")
|
||||
end
|
||||
},
|
||||
{
|
||||
"aaronhallaert/advanced-git-search.nvim",
|
||||
config = function()
|
||||
require("telescope").load_extension("advanced_git_search")
|
||||
end
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
return {
|
||||
"folke/todo-comments.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = function()
|
||||
require("todo-comments").setup({})
|
||||
|
||||
vim.keymap.set("n", "]t", function()
|
||||
require("todo-comments").jump_next()
|
||||
end, { desc = "Next todo comment" }
|
||||
)
|
||||
vim.keymap.set("n", "[t", function()
|
||||
require("todo-comments").jump_prev()
|
||||
end, { desc = "Previous todo comment" }
|
||||
)
|
||||
end
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
return{
|
||||
"mbbill/undotree",
|
||||
config = function()
|
||||
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
|
||||
end
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
return {
|
||||
"christoomey/vim-tmux-navigator",
|
||||
lazy = false,
|
||||
config = function()
|
||||
|
||||
end
|
||||
}
|
||||
@@ -5,8 +5,7 @@ alias sb="source ~/.bashrc"
|
||||
alias bashreload="source ~/.bashrc"
|
||||
alias sz="source ~/.zshrc"
|
||||
alias zshreload="source ~/.zshrc"
|
||||
alias bashrc="${EDITOR:-vim} +116 ~/.bashrc"
|
||||
alias zshrc="${EDITOR:-vim} ~/.zshrc"
|
||||
alias zshrc="${EDITOR} ~/.zshrc"
|
||||
alias free="free -ht"
|
||||
alias type="type -a"
|
||||
alias grep='grep --color=auto'
|
||||
@@ -14,10 +13,11 @@ 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
|
||||
alias wget="wget --hsts-file ${WGET_HSTS_FILE}"
|
||||
|
||||
alias v="${EDITOR}"
|
||||
alias snvim="${HOMEBREW_PREFIX}"/bin/nvim # Stable nvim
|
||||
|
||||
url_encode(){
|
||||
python3 -c "import urllib.parse, sys; print(urllib.parse.quote(sys.stdin.read()))" <<< "$1"
|
||||
}
|
||||
@@ -78,9 +78,8 @@ alias tnew="tmux new"
|
||||
alias tnewt="tmux new -t"
|
||||
|
||||
# Nvim Distro-Switcher
|
||||
alias nvim-lazy=nvim
|
||||
alias nvim-lazy="NVIM_APPNAME=nvim-lazy nvim"
|
||||
alias OldConfig="NVIM_APPNAME=oldconfig nvim"
|
||||
alias nvim-chad="NVIM_APPNAME=nvchad nvim"
|
||||
nvims() {
|
||||
items=$(find -L "$HOME"/.config -maxdepth 2 -name "init.lua" -type f -execdir sh -c 'pwd | xargs basename' \;)
|
||||
config=$(printf "%s\n" "${items[@]}" | fzf --prompt=" Neovim Config " --height=~50% --layout=reverse --border --exit-0)
|
||||
|
||||
1580
common/.config/shell/p10k.zsh
Normal file
1580
common/.config/shell/p10k.zsh
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,14 +1,14 @@
|
||||
# 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)
|
||||
# Rename Session -> <ctrl-a> $
|
||||
# Rename Tab -> <ctrl-a> ,
|
||||
# Next/prev tab -> <ctrl-a> n/p
|
||||
# H-split/V-split -> <ctrl-a> s/v
|
||||
# Resize Pane -> <ctrl-a> leave alt -> h,j,k,l (repeat press)
|
||||
# Switch Pane -> <ctrl-h,j,k,l>
|
||||
# Enter copy mode -> <alt-a>[
|
||||
# Enter copy mode -> <ctrl-a>[
|
||||
# Exit copy mode -> <enter>
|
||||
# Reload tmux.conf -> <alt-a> r
|
||||
# Reload tmux.conf -> <ctrl-a> r
|
||||
|
||||
# More at: https://tmuxcheatsheet.com
|
||||
|
||||
@@ -17,10 +17,10 @@
|
||||
#========================================================
|
||||
# KEY BINDINGS
|
||||
#========================================================
|
||||
# Change Tmux leader key to -> <alt-a>
|
||||
# Change Tmux leader key to -> <ctrl-a>
|
||||
unbind C-b
|
||||
set -g prefix M-a
|
||||
bind-key M-a send-prefix
|
||||
set -g prefix C-a
|
||||
bind-key C-a send-prefix
|
||||
|
||||
# Kill current session with q
|
||||
bind q confirm-before kill-session
|
||||
@@ -52,11 +52,11 @@ 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."
|
||||
bind r source-file "$XDG_CONFIG_HOME/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"
|
||||
# Change resurrect keys to <ctrl-s>(Save) & <ctrl-r>(Resurrect)
|
||||
set -g @resurrect-save "C-s"
|
||||
set -g @resurrect-restore "C-r"
|
||||
|
||||
#========================================================
|
||||
# OPTIONS
|
||||
@@ -77,7 +77,7 @@ 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"
|
||||
set -g @resurrect-dir "$XDG_CONFIG_HOME/tmux/resurrect"
|
||||
|
||||
# Don't exit tmux when closing a session
|
||||
set -g detach-on-destroy off
|
||||
@@ -102,9 +102,7 @@ set -g status-position top
|
||||
#========================================================
|
||||
# PLUGINS
|
||||
#========================================================
|
||||
run "~/.config/tmux/plugins/tpm/tpm" # Init Tmux Plugin Manager
|
||||
|
||||
# TODO: Get into Tmux copy stuff when required
|
||||
run "$XDG_CONFIG_HOME/tmux/plugins/tpm/tpm" # Init Tmux Plugin Manager
|
||||
|
||||
set -g @plugin "christoomey/vim-tmux-navigator" # sync pane nav with Vim window nav
|
||||
set -g @plugin "tmux-plugins/tmux-resurrect" # Persist sessions
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
[user]
|
||||
email = mail@pratik.live
|
||||
name = Pratik Tripathy
|
||||
email = mail@pratik.live
|
||||
name = Pratik Tripathy
|
||||
[core]
|
||||
autocrlf = input
|
||||
editor = code --wait
|
||||
autocrlf = input
|
||||
editor = code --wait
|
||||
[diff]
|
||||
tool = vscode
|
||||
tool = vscode
|
||||
[difftool "vscode"]
|
||||
cmd = "code --wait --diff $LOCAL $REMOTE"
|
||||
cmd = "code --wait --diff $LOCAL $REMOTE"
|
||||
[alias]
|
||||
ll = log --pretty=format:'%Cblue%cn (%ce)%Creset commited %Cred%h%Creset %Cgreen%cr%Creset:%n%B'
|
||||
unstage = restore --staged .
|
||||
ll = log --pretty=format:'%Cblue%cn (%ce)%Creset commited %Cred%h%Creset %Cgreen%cr%Creset:%n%B'
|
||||
unstage = restore --staged .
|
||||
|
||||
|
||||
2
common/.gitignore
vendored
2
common/.gitignore
vendored
@@ -98,3 +98,5 @@ lerna-debug.log*
|
||||
**/contents/fonts
|
||||
*kpluginindex.json
|
||||
|
||||
*.bak
|
||||
nvim_switch/
|
||||
|
||||
@@ -1,38 +1,31 @@
|
||||
# set PATH so it includes user's private bin if it exists
|
||||
if [ -d "$HOME/bin" ]; then
|
||||
PATH="$HOME/bin:$PATH"
|
||||
fi
|
||||
[ ! -f "/home/linuxbrew/.linuxbrew/bin/brew" ] || eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
|
||||
|
||||
# set PATH so it includes user's private bin if it exists
|
||||
if [ -d "$HOME/.local/bin" ]; then
|
||||
PATH="$HOME/.local/bin:$PATH"
|
||||
fi
|
||||
[ ! -d "$HOME/bin" ] || PATH="$HOME/bin:$PATH"
|
||||
|
||||
# set PATH so it includes user's private bin if it exists
|
||||
[ ! -d "$HOME/.local/bin" ] || PATH="$HOME/.local/bin:$PATH"
|
||||
|
||||
# Set the config directory enviroment variable
|
||||
if [ -z "$XDG_CONFIG_HOME" ]; then
|
||||
export XDG_CONFIG_HOME="$HOME/.config"
|
||||
fi
|
||||
[ ! -z "$XDG_CONFIG_HOME" ] || export XDG_CONFIG_HOME="$HOME/.config"
|
||||
|
||||
# Set the cache directory enviroment variable
|
||||
if [ -z "$XDG_CACHE_HOME" ]; then
|
||||
export XDG_CACHE_HOME="$HOME/.cache"
|
||||
fi
|
||||
[ ! -z "$XDG_CACHE_HOME" ] || export XDG_CACHE_HOME="$HOME/.cache"
|
||||
|
||||
# Set the data directory enviroment variable
|
||||
if [ -z "$XDG_DATA_HOME" ]; then
|
||||
export XDG_DATA_HOME="$HOME/.local/share"
|
||||
fi
|
||||
[ ! -z "$XDG_DATA_HOME" ] || export XDG_DATA_HOME="$HOME/.local/share"
|
||||
|
||||
# Set the state directory enviroment variable
|
||||
if [ -z "$XDG_STATE_HOME" ]; then
|
||||
export XDG_STATE_HOME="$HOME/.local/state"
|
||||
fi
|
||||
[ ! -z "$XDG_STATE_HOME" ] || export XDG_STATE_HOME="$HOME/.local/state"
|
||||
|
||||
##################################################################################
|
||||
|
||||
eval "$(ssh-agent -s)" >/dev/null
|
||||
ulimit -n 10240
|
||||
|
||||
EDITOR=$(command -v nvim 2>/dev/null || command -v vim 2>/dev/null)
|
||||
VISUAL=$EDITOR
|
||||
|
||||
# Manually follow steps from https://steamcommunity.com/app/646570/discussions/1/3935537639868400686
|
||||
# To disable ~/.oracle_jre_usage/ from being created
|
||||
|
||||
@@ -43,13 +36,12 @@ ulimit -n 10240
|
||||
[ ! -f "$XDG_CONFIG_HOME/shell/aliases_personal" ] || source "$XDG_CONFIG_HOME/shell/aliases_personal"
|
||||
|
||||
if [ "$(uname -s)" = "Linux" ]; then
|
||||
export QT_PLUGIN_PATH="~/.local/lib/qt/plugins/:"
|
||||
export QT_PLUGIN_PATH="~/.local/lib/qt/plugins/:" # TODO: Mac as well?
|
||||
export __GL_SHADER_DISK_CACHE_PATH="$XDG_CACHE_HOME/nvidia"
|
||||
|
||||
# Needs upstream fix to work: https://bugs.kde.org/show_bug.cgi?id=415770
|
||||
export GTK2_RC_FILES="$XDG_CONFIG_HOME/gtk-2.0/gtkrc-2.0"
|
||||
|
||||
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
|
||||
export CUDA_CACHE_PATH="XDG_CACHE_HOME/nv"
|
||||
fi
|
||||
|
||||
if [ "$XDG_SESSION_DESKTOP" = "KDE" ]; then
|
||||
@@ -65,27 +57,32 @@ export ADB_VENDOR_KEYS="$XDG_CONFIG_HOME/android"
|
||||
|
||||
# Setup Python
|
||||
export PYENV_ROOT="$XDG_DATA_HOME/pyenv"
|
||||
command -v pyenv >/dev/null || export PATH="$PATH:$PYENV_ROOT/bin"
|
||||
command -v pyenv >/dev/null || eval "$(pyenv init -)"
|
||||
export PYTHON_HISTORY="$XDG_STATE_HOME/shell/python_history" # will become availble in python 3.13
|
||||
command -v pyenv >/dev/null && export PATH="$PATH:$PYENV_ROOT/bin"
|
||||
command -v pyenv >/dev/null && eval "$(pyenv init -)"
|
||||
export PYTHON_HISTORY="$XDG_STATE_HOME/shell/python_history" # will be picked up by Python 3.13+
|
||||
|
||||
# Setup Rust
|
||||
export CARGO_HOME="$XDG_DATA_HOME/rust/cargo"
|
||||
export RUSTUP_HOME="$XDG_DATA_HOME/rust/rustup"
|
||||
export PATH="$PATH:$CARGO_HOME/bin"
|
||||
export RUSTC_WRAPPER=sccache # Setup Shared cache for Rust
|
||||
export RUSTC_WRAPPER=sccache
|
||||
export SCCACHE_CACHE_SIZE="20G"
|
||||
|
||||
# Setup DotNet
|
||||
export DOTNET_CLI_TELEMETRY_OPTOUT=1
|
||||
export DOTNET_CLI_HOME="$XDG_CONFIG_HOME/dotnet"
|
||||
|
||||
# Setup Node & nvm
|
||||
# Cause we need it available on login
|
||||
alias code="code --extensions-dir $XDG_DATA_HOME/vscode"
|
||||
|
||||
# Java
|
||||
export _JAVA_OPTIONS=-Djava.util.prefs.userRoot="$XDG_CONFIG_HOME/java"
|
||||
|
||||
# Setup Node & n
|
||||
export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME/node/npmrc"
|
||||
export NODE_REPL_HISTORY="$XDG_CONFIG_HOME/node/node_repl_history"
|
||||
export NVM_DIR="$XDG_DATA_HOME/nvm"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
||||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
|
||||
export N_PREFIX="$XDG_DATA_HOME/nvm" # "n" would be confusing
|
||||
export PATH="$N_PREFIX/bin:$PATH"
|
||||
|
||||
export AWS_CONFIG_FILE="$XDG_CONFIG_HOME/aws/config"
|
||||
export AWS_SHARED_CREDENTIALS_FILE="$XDG_CONFIG_HOME/aws/credentials"
|
||||
|
||||
@@ -1,77 +1,65 @@
|
||||
syntax on " Syntax highlighting.
|
||||
set nocompatible " Do not worry about backward compatibility with VI
|
||||
set cursorline " Hightlight cursor line
|
||||
set showmatch " Highlight matching braces
|
||||
set noshowmode " Donot write "--INSERT--" etc.
|
||||
set showcmd " Write out commands on status line
|
||||
set laststatus=2 " Show a status line
|
||||
set wrap " Wrap text
|
||||
set number " Show line numbers
|
||||
set relativenumber " Relative line numbers
|
||||
set ruler " Show the line & column number of the cursor
|
||||
set shortmess+=I " Disable the default Vim startup message.
|
||||
set shortmess+=s " Less verbose search messages
|
||||
set mouse+=a " Enable mouse support
|
||||
set encoding=utf-8 " Encoding
|
||||
set autoread " Auto reload file if externally changed
|
||||
set nrformats-=octal " Do not let Ctrl-a + Ctrl-x work on octal format numbers
|
||||
set formatoptions+=j " When joining lines with J, delete comment characters
|
||||
set display+=truncate " @@@ is displayed in the 1st column of the last screen line
|
||||
set tabpagemax=50 " Max number of tabs
|
||||
set viminfo^=!
|
||||
set viewoptions-=options
|
||||
set nolangremap " Do not use non-English keyboards to define keymaps
|
||||
set list " Show tabs as >, trailing spaces as -, non-breakable space as +
|
||||
set signcolumn=yes " Always show the signs column (before line number column)
|
||||
set scrolloff=5 " Cursor always at middle of the screen
|
||||
set updatetime=249 " No typing for this millisec -> write to swap file
|
||||
set timeoutlen=500 " Multiple keys in keymaps must be pressed in these millisecs
|
||||
set noswapfile " Turn off swapfiles
|
||||
set history=10000 " Number of : commands to save
|
||||
set undofile " Turn on undofiles (files not compatible across Vim & Nvim
|
||||
set undolevels=10000 " Number of undos per file (will be stored in memory)
|
||||
set undoreload=100000 " Amount of memory to use when reloading the buffer with :e!
|
||||
set sessionoptions-=options " Do NOT save options and mappings in session
|
||||
set splitbelow " Split new windows at bottom instead of top
|
||||
set splitright " New vertical windows on right instead of left
|
||||
set hidden " Allows to change buffer without saving it 1st
|
||||
set virtualedit=block " Makes visual block better when selecting different line sizes
|
||||
set ignorecase " When trying to autocomplete commands or searching, ignore case
|
||||
set noerrorbells novisualbell t_vb= " Disable all bells
|
||||
|
||||
" Make sure tabs are 4 character wide
|
||||
set shiftwidth=4 tabstop=4 softtabstop=4 expandtab smarttab
|
||||
set autoindent smartindent breakindent " Proper indentation
|
||||
|
||||
" 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
|
||||
|
||||
" Better autocompletes
|
||||
filetype plugin indent on
|
||||
set omnifunc=syntaxcomplete#Complete
|
||||
set complete+=kspell
|
||||
set complete-=i
|
||||
set completeopt="menuone,noselect"
|
||||
set wildmenu " List and cycle through autocomplete on <Tab>
|
||||
set wildignorecase " Case insensitive path completion
|
||||
set completeopt="menuone,noselect" " Better completion experience
|
||||
set wildmenu " List and cycle through autocomplete on <Tab>
|
||||
set wildignorecase " Case insensitive path completion
|
||||
|
||||
" Make sure tabs are 4 character wide
|
||||
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 noshowmode " Donot write "--INSERT--" etc.
|
||||
set showcmd " Write out commands on status line
|
||||
set laststatus=2 " Show a status line
|
||||
set wrap " Wrap text
|
||||
set number " Show line numbers
|
||||
set relativenumber " Relative line numbers
|
||||
set ruler
|
||||
set shortmess+=I " Disable the default Vim startup message.
|
||||
set noerrorbells novisualbell 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 tabpagemax=50
|
||||
set viminfo^=!
|
||||
set viewoptions-=options
|
||||
set nolangremap
|
||||
set list
|
||||
set signcolumn=yes
|
||||
set scrolloff=5
|
||||
set isfname+={,},@-@
|
||||
set updatetime=50
|
||||
set noswapfile
|
||||
set history=1000
|
||||
set undofile
|
||||
set undolevels=10000
|
||||
set undoreload=100000
|
||||
set sessionoptions-=options
|
||||
set timeoutlen=500
|
||||
|
||||
" 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.
|
||||
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\+$/
|
||||
" Remove trailing blank spaces on save
|
||||
autocmd BufWritePre * %s/\s\+$//e
|
||||
|
||||
" Vim is based on Vi. Setting `nocompatible` switches from the default
|
||||
" Vi-compatibility mode and enables useful Vim functionality. This
|
||||
" configuration option turns out not to be necessary for the file named
|
||||
" '~/.vimrc', because Vim automatically enters nocompatible mode if that file
|
||||
" is present. But we're including it here just in case this config file is
|
||||
" loaded some other way (e.g. saved as `foo`, and then Vim started with
|
||||
" `vim -u foo`).
|
||||
set nocompatible
|
||||
|
||||
" Normally, backspace works only if you have made an edit. This fixes that.
|
||||
set backspace=indent,eol,start
|
||||
|
||||
@@ -87,5 +75,4 @@ if !has('gui_running')
|
||||
set t_Co=256
|
||||
set termguicolors
|
||||
hi LineNr ctermbg=NONE guibg=NONE
|
||||
set termguicolors
|
||||
endif
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
" Make space-bar the leader-key
|
||||
let mapleader = " "
|
||||
let maplocalleader = " "
|
||||
|
||||
" Don't do anything on pressing space itself
|
||||
nnoremap <Space> <Nop>
|
||||
vnoremap <Space> <Nop>
|
||||
|
||||
" Disable left, right, up and down keys
|
||||
" In normal mode...
|
||||
nnoremap <Left> :echoe "Use h"<CR>
|
||||
@@ -13,14 +21,6 @@ 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
|
||||
|
||||
@@ -8,12 +8,10 @@ if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]
|
||||
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
|
||||
fi
|
||||
|
||||
# If you come from bash you might have to change your $PATH.
|
||||
# export PATH=$HOME/bin:/usr/local/bin:$PATH
|
||||
|
||||
# Path to your oh-my-zsh installation.
|
||||
export ZSH="$XDG_CONFIG_HOME/shell/oh-my-zsh"
|
||||
source "${ZSH}/custom/themes/powerlevel10k/powerlevel10k.zsh-theme"
|
||||
export ZSH="$XDG_DATA_HOME/shell/oh-my-zsh"
|
||||
export ZSH_CUSTOM="$ZSH/custom"
|
||||
source "${ZSH_CUSTOM}/themes/powerlevel10k/powerlevel10k.zsh-theme"
|
||||
|
||||
ZSH_THEME="powerlevel10k/powerlevel10k"
|
||||
|
||||
@@ -50,27 +48,29 @@ HIST_STAMPS="dd.mm.yyyy"
|
||||
plugins=(
|
||||
git
|
||||
# dotenv
|
||||
# dotnet
|
||||
gitignore
|
||||
# colored-man-pages
|
||||
# docker
|
||||
docker
|
||||
# fd
|
||||
# nvm
|
||||
per-directory-history
|
||||
# ripgrep
|
||||
sudo
|
||||
zsh-syntax-highlighting
|
||||
zsh-autosuggestions
|
||||
vi-mode
|
||||
# exercism
|
||||
exercism
|
||||
)
|
||||
VI_MODE_SET_CURSOR=true
|
||||
VI_MODE_CURSOR_INSERT=3
|
||||
zstyle ':omz:plugins:nvm' lazy yes
|
||||
HISTORY_BASE="$XDG_STATE_HOME/shell/per-directory-history"
|
||||
|
||||
source $ZSH/oh-my-zsh.sh
|
||||
compinit -d "$XDG_CACHE_HOME/zcompdump"
|
||||
# NOTE: Should be exported before sourcing oh-my-zsh, to avoid the dumpfiles on $HOME
|
||||
export ZSH_COMPDUMP=$XDG_CACHE_HOME/zsh/zcompdump-$HOST
|
||||
|
||||
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
|
||||
source $ZSH/oh-my-zsh.sh
|
||||
|
||||
# To customize prompt, run `p10k configure`
|
||||
[[ ! -f "$XDG_CONFIG_HOME/shell/p10k.zsh" ]] || source "$XDG_CONFIG_HOME/shell/p10k.zsh"
|
||||
|
||||
# User configuration
|
||||
@@ -91,8 +91,27 @@ setopt HIST_IGNORE_SPACE # Don't add commands that start with whitespac
|
||||
# enable vi-mode
|
||||
bindkey -v
|
||||
|
||||
# [ ! -f "$XDG_CONFIG_HOME/exercism/exercism_completion.zsh" ] || source "$XDG_CONFIG_HOME/exercism/exercism_completion.zsh"
|
||||
# Basic auto/tab completions
|
||||
autoload -U compinit
|
||||
zstyle ':completion:*' menu select cache-path "$XDG_CACHE_HOME/zsh/zcompcache"
|
||||
zmodload zsh/complist
|
||||
compinit -d "$XDG_CACHE_HOME/zsh/zcompdump-$ZSH_VERSION"
|
||||
_comp_options+=(globdots) # Include hidden files
|
||||
|
||||
# [ctrl+r]:replaces shell command search
|
||||
# [ctrl+t]:fzf & over the files & directories under the current one & paste it to prompt
|
||||
# [alt+c] :fzf & cd into a directory under the current one
|
||||
[ -f $XDG_STATE_HOME/shell/fzf.zsh ] && source $XDG_STATE_HOME/shell/fzf.zsh
|
||||
|
||||
# FPATH="$FPATH:$HOMEBREW_PREFIX/share/zsh/site-functions" # TODO: Make the completions here work
|
||||
|
||||
command -v zoxide >/dev/null && eval "$(zoxide init zsh)"
|
||||
|
||||
# TODO: Use fzf + fd + kitty to auto create kitty sessions: use only the following directories
|
||||
# 1. /media/pratik/Office/Code/
|
||||
# 2. /media/pratik/Projects/LearningProjects/
|
||||
# 3. /media/pratik/Projects/PersonalProjects/
|
||||
# 4. /media/pratik/Projects/Interviews/
|
||||
# - Ignore hidden directories
|
||||
# - Put it in one of the aliases
|
||||
|
||||
if command -v zoxide >/dev/null; then
|
||||
eval "$(zoxide init zsh)"
|
||||
fi
|
||||
|
||||
@@ -23,7 +23,7 @@ alias listening_apps="sudo netstat -nutlp | grep ':' | awk '{print \$1,\$4,\$NF}
|
||||
|
||||
|
||||
# Update & Upgrades
|
||||
alias up="sudo pkcon refresh && sudo pkcon update && sudo apt dist-upgrade && sudo apt autoremove && rustup update && brew upgrade && npm update -g"
|
||||
alias up="sudo pkcon refresh && sudo pkcon update && sudo apt dist-upgrade && sudo apt autoremove && rustup update && brew upgrade && brew autoremove && npm update -g"
|
||||
alias distup="sudo apt dist-upgrade"
|
||||
alias autorem="sudo apt autoremove"
|
||||
alias update="sudo apt-get update"
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Directories and Directory listings
|
||||
dir_size(){
|
||||
local dir
|
||||
if [[ -z "$1" ]]; then
|
||||
dir="${PWD}"
|
||||
else
|
||||
dir="$1"
|
||||
fi
|
||||
dir_size() {
|
||||
local dir
|
||||
if [[ -z "$1" ]]; then
|
||||
dir="${PWD}"
|
||||
else
|
||||
dir="$1"
|
||||
fi
|
||||
|
||||
du -ah "${dir}" -d 1 | sort -hr
|
||||
du -ah "${dir}" -d 1 | sort -hr
|
||||
}
|
||||
|
||||
|
||||
# Update & Upgrades
|
||||
alias up="brew upgrade --cask && brew upgrade --formula && rustup update && npm update -g"
|
||||
alias up="brew upgrade --cask && brew upgrade --formula && brew autoremove && rustup update && npm update -g"
|
||||
|
||||
Reference in New Issue
Block a user