# Tmux Config

- Added Catppuccin theme
- Added kitty terminal config

# Sync and Rectify Vim & NVIM

- Undo files are incompatible between VIM & NVIM - saved those files separately
- Keybinding for saving and quitting moved to VIM config
- VIM & NVIM swapfiles removed
- More VIM options set to enhance usability
- Synced system vim config and keybindings with ideavimrc

# Shell Script File Changes

- Reverted to using `#!/bin/sh` as bash is slow and not POSIX compliant.
- Reformatted
This commit is contained in:
Pratik Tripathy
2024-01-02 23:45:41 +05:30
parent 0402ee5481
commit f780d7f6bd
20 changed files with 4378 additions and 1799 deletions

7
.gitignore vendored
View File

@@ -77,13 +77,8 @@ dist-ssr
*.min.js *.min.js
# Log files # Log files
logs ..logs/
*.log *.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
# Other Files to ignore # Other Files to ignore
**app_stat_v2.db **app_stat_v2.db

View File

@@ -21,4 +21,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. 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 --> <!-- TODO: Move as many dotfiles inside ~/.config as possible -->

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/bin/sh
# Generic # Generic
alias sb="source ~/.bashrc" alias sb="source ~/.bashrc"
@@ -16,6 +16,7 @@ alias usersearch="awk -F: '{print \"UserName: \" \$1 \", UserID: \" \$3 \", Home
alias untar='tar -zxvf ' alias untar='tar -zxvf '
alias v=nvim alias v=nvim
alias n=nvim alias n=nvim
alias vim=nvim
url_encode(){ url_encode(){
python3 -c "import urllib.parse, sys; print(urllib.parse.quote(sys.stdin.read()))" <<< "$1" python3 -c "import urllib.parse, sys; print(urllib.parse.quote(sys.stdin.read()))" <<< "$1"

File diff suppressed because it is too large Load Diff

View File

@@ -1,2 +1,3 @@
-- Nvim Specific Configs that don't apply to VIM vim.opt.undodir = vim.fn.stdpath("config") .. "/undo"
vim.opt.backupdir = vim.fn.stdpath("config") .. "/backup/"

View File

@@ -1,8 +1,3 @@
-- <Ctrl-Alt-s> -> to save all files
vim.keymap.set({ "n", "i", "v" }, "<C-M-s>", "<cmd>wa<CR>", {})
-- <Ctrl-q> -> Save all files and quit Nvim
vim.keymap.set({ "n", "i", "v" }, "<C-q>", "<cmd>wqa<CR>", {})
-- Remap for dealing with word wrap -- Remap for dealing with word wrap
vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true }) 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 }) vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })

View File

@@ -1,10 +1,9 @@
"""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""
" "
" Source common configs from VIM " Source common keymaps & configs from VIM
" "
"""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""
let $VIMDIR="$HOME/.vim" let $VIMDIR="$HOME/.vim"
let $NVIMDIR="$HOME/.config/nvim"
" Load VIM Configurations " Load VIM Configurations
source $VIMDIR/configs.vim source $VIMDIR/configs.vim
@@ -14,4 +13,3 @@ source $VIMDIR/key_maps.vim
" Save session files to $HOME/.vim/session directory " Save session files to $HOME/.vim/session directory
let g:session_dir="$VIMDIR/session" let g:session_dir="$VIMDIR/session"

View File

@@ -79,6 +79,9 @@ set -g @resurrect-capture-pane-contents "on"
set -g @resurrect-strategy-nvim "session" set -g @resurrect-strategy-nvim "session"
set -g @resurrect-dir "$HOME/.config/tmux/resurrect" set -g @resurrect-dir "$HOME/.config/tmux/resurrect"
# Don't exit tmux when closing a session
set -g detach-on-destroy off
#======================================================== #========================================================
# APPEARANCE # APPEARANCE
#======================================================== #========================================================
@@ -89,7 +92,8 @@ set -g renumber-windows on
set-window-option -g pane-base-index 1 set-window-option -g pane-base-index 1
# Improve colors # Improve colors
set -g default-terminal "xterm-256color" set -g default-terminal "${TERM}"
set-option -g default-terminal "xterm-256color"
set-option -sa terminal-overrides ",xterm*:Tc" set-option -sa terminal-overrides ",xterm*:Tc"
# Status at top # Status at top
@@ -101,23 +105,38 @@ set -g status-position top
run "~/.config/tmux/plugins/tpm/tpm" # Init Tmux Plugin Manager run "~/.config/tmux/plugins/tpm/tpm" # Init Tmux Plugin Manager
# TODO: Get into Tmux copy stuff when required # TODO: Get into Tmux copy stuff when required
# set -g @plugin 'tmux-plugins/tmux-yank'
# set -g @plugin "tmux-plugins/tmux-copycat"
set -g @plugin "christoomey/vim-tmux-navigator" # sync pane nav with Vim window nav set -g @plugin "christoomey/vim-tmux-navigator" # sync pane nav with Vim window nav
set -g @plugin "tmux-plugins/tmux-resurrect" # Persist sessions set -g @plugin "tmux-plugins/tmux-resurrect" # Persist sessions
set -g @plugin "tmux-plugins/tmux-continuum" # Auto save sessions every 15mins set -g @plugin "tmux-plugins/tmux-continuum" # Auto save sessions every 15mins
set -g @plugin 'tmux-plugins/tmux-yank' set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin "tmux-plugins/tmux-copycat" set -g @plugin "tmux-plugins/tmux-copycat"
set -g @plugin "fabioluciano/tmux-tokyo-night" set -g @plugin "catppuccin/tmux"
#======================================================== #========================================================
# PLUGINS Configurations # PLUGINS Configurations
#======================================================== #========================================================
# Color schemes # Color schemes
set -g @theme_variation "night" set -g @catppuccin_flavour "mocha"
set -g @theme_disable_plugins 1
set -g status-right "" set -g @catppuccin_window_left_separator ""
set -g @catppuccin_window_right_separator " "
set -g @catppuccin_window_middle_separator " █"
set -g @catppuccin_status_left_separator " "
set -g @catppuccin_status_right_separator " "
set -g @catppuccin_status_right_separator_inverse "no"
set -g @catppuccin_status_fill "icon"
set -g @catppuccin_window_current_text "#W"
set -g @catppuccin_window_current_fill "number"
set -g @catppuccin_window_default_text "#W"
set -g @catppuccin_window_default_fill "number"
set -g @catppuccin_window_status_enable "yes"
set -g @catppuccin_window_status_icon_enable "yes"
set -g @catppuccin_window_number_position "right"
set -g @catppuccin_status_connect_separator "no"
set -g @catppuccin_directory_text "#{pane_current_path}"
set -g @catppuccin_status_modules_right "session directory"
set -g @plugin "tmux-plugins/tpm" set -g @plugin "tmux-plugins/tpm"

View File

@@ -6,7 +6,7 @@ return {
font = wezterm.font_with_fallback({ font = wezterm.font_with_fallback({
-- "JetBrains Mono", -- "JetBrains Mono",
"JetBrainsMono Nerd Font", "JetBrainsMono Nerd Font",
{ family = "Symbols Nerd Font Mono", scale = 0.75 } { family = "Symbols Nerd Font Mono", scale = 0.75 },
}), }),
window_decorations = "RESIZE", window_decorations = "RESIZE",
enable_tab_bar = true, enable_tab_bar = true,
@@ -36,7 +36,7 @@ return {
event = { Up = { streak = 1, button = "Left" } }, event = { Up = { streak = 1, button = "Left" } },
mods = "CTRL", mods = "CTRL",
action = wezterm.action.OpenLinkAtMouseCursor, action = wezterm.action.OpenLinkAtMouseCursor,
} },
}, },
force_reverse_video_cursor = true, force_reverse_video_cursor = true,

View File

@@ -6,6 +6,9 @@
"source ~/.vimrc "source ~/.vimrc
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
source ~/.vim/configs.vim
source ~/.vim/key_maps.vim
" Set Tabs to 4 characters " Set Tabs to 4 characters
set expandtab set expandtab
set tabstop=4 set tabstop=4
@@ -19,13 +22,8 @@ set incsearch " show search results while typing
set wrapscan " searches wrap around the end of the file set wrapscan " searches wrap around the end of the file
" Common settings " Common settings
set number " Show current line number
set relativenumber " Show relative line numbers
set gdefault " substitute all occurrences in line set gdefault " substitute all occurrences in line
set history=10000 " command line history
set scrolloff=5 sidescrolloff=10 " Keep some line before and after the cursor visible
set clipboard^=unnamed,unnamedplus,ideaput " Copy to and from system clipboard set clipboard^=unnamed,unnamedplus,ideaput " Copy to and from system clipboard
set nrfomats+=alpha,bin,octal,hex " Useful for auto incrementing
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Enabled plugins " Enabled plugins
@@ -41,31 +39,16 @@ Plug 'tpope/vim-repeat' " Repeat for Surround
" Plug 'terryma/vim-multiple-cursors' " mc (selects), mx (skips), mp (previous) " Plug 'terryma/vim-multiple-cursors' " mc (selects), mx (skips), mp (previous)
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" To see a list of all available :actions -> :actionlist
" Or select "IdeaVim: Track Action Ids" -> Copy the action id required
" Keymaps
let mapleader = " "
" Don't use Ex mode, use Q for formatting
map Q gq
" Map <leader>d to start debug " Map <leader>d to start debug
"map <leader>d <Action>(Debug) "map <leader>d <Action>(Debug)
" Map \b to toggle breakpoint " Map \b to toggle breakpoint
"map \b <Action>(ToggleLineBreakpoint) "map \b <Action>(ToggleLineBreakpoint)
" Center the cursor when doing 1/2 page down and page up
nnoremap <C-d> <C-d>zz
nnoremap <C-u> <C-u>zz
" Multiple Cursors " Multiple Cursors
map mc <A-n> map mc <A-n>
map mx <A-x> map mx <A-x>
map mp <A-p> map mp <A-p>
" Clear search highlighting
nnoremap <leader>/ :nohls<return><esc>
" Find/Open file " Find/Open file
nmap <leader>of :action GotoFile<CR> nmap <leader>of :action GotoFile<CR>
nmap <leader>or :action RecentFiles<CR> nmap <leader>or :action RecentFiles<CR>

View File

@@ -25,6 +25,3 @@ fi
if [ -d "$HOME/.local/bin" ] ; then if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH" PATH="$HOME/.local/bin:$PATH"
fi fi
# Remap caps lock to escape
setxkbmap -option caps:escape

View File

@@ -4,18 +4,21 @@ set omnifunc=syntaxcomplete#Complete
set complete+=kspell set complete+=kspell
set complete-=i set complete-=i
set completeopt="menuone,noselect" set completeopt="menuone,noselect"
set wildmenu " List and cycle through autocomplete on <Tab>
set wildignorecase " Case insensitive path completion
" Make sure tabs are 4 character wide " Make sure tabs are 4 character wide
set shiftwidth=4 tabstop=4 softtabstop=4 expandtab smarttab set shiftwidth=4 tabstop=4 softtabstop=4 expandtab smarttab
set autoindent smartindent breakindent set autoindent smartindent breakindent
syntax on " syntax highlighting. syntax on " Syntax highlighting.
syntax enable syntax enable
set cursorline " Hightlight cursor line set cursorline " Hightlight cursor line
set showmatch " Highlight matching braces set showmatch " Highlight matching braces
set noshowmode " Donot write "--INSERT--" etc.
set showcmd " Write out commands on status line
set ls=2 " Show a status line set ls=2 " Show a status line
set wrap " Wrap text set wrap " Wrap text
set wildmenu " Makes the ex command mode autocomplete paths with Tab
set number " Show line numbers set number " Show line numbers
set ruler set ruler
set relativenumber " Relative line numbers set relativenumber " Relative line numbers
@@ -39,11 +42,10 @@ set signcolumn=yes
set scrolloff=5 set scrolloff=5
set isfname+={,},@-@ set isfname+={,},@-@
set updatetime=50 set updatetime=50
set noswapfile
" Enable undofile and save them in ~/.vim/undo set undofile
set undofile " Enable undofiles set undolevels=10000
set undodir=$HOME/.vim/undo// " Save in each project's root set undoreload=100000
set directory^=$HOME/.vim/swap// " All swap files at the one place please
" Vim, by default, won't let you jump to a different file without saving the " 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. " current one. With the below, unsaved files are just hidden.
@@ -56,8 +58,8 @@ set incsearch hlsearch ignorecase smartcase
hi Comment guifg=#5C6370 ctermfg=50 cterm=italic hi Comment guifg=#5C6370 ctermfg=50 cterm=italic
" Highlight and remove trailing blank spaces on save " Highlight and remove trailing blank spaces on save
match ExtraWhitespace /\s\+$/
highlight ExtraWhitespace ctermbg=red guibg=red highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
autocmd BufWritePre * %s/\s\+$//e autocmd BufWritePre * %s/\s\+$//e
" Vim is based on Vi. Setting `nocompatible` switches from the default " Vim is based on Vi. Setting `nocompatible` switches from the default
@@ -87,3 +89,6 @@ if !has('gui_running')
set termguicolors set termguicolors
endif endif
" NERDTree Plugin configurations
let g:NERDTreeShowHidden = 1
let g:NERDTreeWinSize = 25

View File

@@ -58,9 +58,10 @@ map <leader>j <Plug>(easymotion-s)
" Map nerdtree to <Leader>e " Map nerdtree to <Leader>e
" Changes the pwd and opens the VCS root " Changes the pwd and opens the VCS root
nnoremap <leader>e :tcd %:h<CR> :NERDTreeToggleVCS<CR> nnoremap <leader>e :tcd %:h<CR> :NERDTreeToggleVCS<CR>
let g:NERDTreeShowHidden = 1
let g:NERDTreeWinSize = 25
" <ctrl-q> to save everything and quit Neovim " <ctrl-q> to save everything and quit Neovim
nnoremap <C-q> :wqa<CR> nnoremap <C-q> :wqa<CR>
vnoremap <C-q> :wqa<CR>
nnoremap <C-s> :wa<CR>
vnoremap <C-s> :wa<CR>

View File

@@ -30,3 +30,6 @@ colorscheme deep-space
" Auto reload .vimrc " Auto reload .vimrc
autocmd! bufwritepost $VIMRC source % autocmd! bufwritepost $VIMRC source %
" Save inside vim config directory
set undodir=$VIMDIR/undo//

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/bin/sh
# Directories and Directory listings # Directories and Directory listings
dir_size(){ dir_size(){

View File

@@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/bin/sh
# Directories and Directory listings # Directories and Directory listings
dir_size(){ dir_size(){
@@ -15,4 +15,3 @@ dir_size(){
# Update & Upgrades # Update & Upgrades
alias up="brew upgrade --cask && brew upgrade --formula && rustup update && npm update -g" alias up="brew upgrade --cask && brew upgrade --formula && rustup update && npm update -g"