# 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
# Log files
logs
..logs/
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
# Other Files to ignore
**app_stat_v2.db

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

View File

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

View File

@@ -5,7 +5,7 @@
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
*) return ;;
esac
# append to the history file, don't overwrite it
@@ -29,7 +29,7 @@ fi
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color|*-256color) color_prompt=yes;;
xterm-color|*-256color) color_prompt=yes ;;
esac
# uncomment for a colored prompt, if the terminal has the capability; turned
@@ -56,10 +56,10 @@ unset color_prompt force_color_prompt
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
*)
;;
esac

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
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 })

View File

@@ -1,10 +1,9 @@
""""""""""""""""""""""""""""""""""""""
"
" Source common configs from VIM
" Source common keymaps & configs from VIM
"
""""""""""""""""""""""""""""""""""""""
let $VIMDIR="$HOME/.vim"
let $NVIMDIR="$HOME/.config/nvim"
" Load VIM Configurations
source $VIMDIR/configs.vim
@@ -14,4 +13,3 @@ source $VIMDIR/key_maps.vim
" Save session files to $HOME/.vim/session directory
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-dir "$HOME/.config/tmux/resurrect"
# Don't exit tmux when closing a session
set -g detach-on-destroy off
#========================================================
# APPEARANCE
#========================================================
@@ -89,7 +92,8 @@ set -g renumber-windows on
set-window-option -g pane-base-index 1
# 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"
# Status at top
@@ -101,23 +105,38 @@ set -g status-position top
run "~/.config/tmux/plugins/tpm/tpm" # Init Tmux Plugin Manager
# TODO: Get into Tmux copy stuff when required
# set -g @plugin 'tmux-plugins/tmux-yank'
# set -g @plugin "tmux-plugins/tmux-copycat"
set -g @plugin "christoomey/vim-tmux-navigator" # sync pane nav with Vim window nav
set -g @plugin "tmux-plugins/tmux-resurrect" # Persist sessions
set -g @plugin "tmux-plugins/tmux-continuum" # Auto save sessions every 15mins
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin "tmux-plugins/tmux-copycat"
set -g @plugin "fabioluciano/tmux-tokyo-night"
set -g @plugin "catppuccin/tmux"
#========================================================
# PLUGINS Configurations
#========================================================
# Color schemes
set -g @theme_variation "night"
set -g @theme_disable_plugins 1
set -g status-right ""
set -g @catppuccin_flavour "mocha"
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"

View File

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

View File

@@ -6,6 +6,9 @@
"source ~/.vimrc
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
source ~/.vim/configs.vim
source ~/.vim/key_maps.vim
" Set Tabs to 4 characters
set expandtab
set tabstop=4
@@ -19,13 +22,8 @@ set incsearch " show search results while typing
set wrapscan " searches wrap around the end of the file
" Common settings
set number " Show current line number
set relativenumber " Show relative line numbers
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 nrfomats+=alpha,bin,octal,hex " Useful for auto incrementing
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Enabled plugins
@@ -41,31 +39,16 @@ Plug 'tpope/vim-repeat' " Repeat for Surround
" 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 <Action>(Debug)
" Map \b to toggle breakpoint
"map \b <Action>(ToggleLineBreakpoint)
" Center the cursor when doing 1/2 page down and page up
nnoremap <C-d> <C-d>zz
nnoremap <C-u> <C-u>zz
" Multiple Cursors
map mc <A-n>
map mx <A-x>
map mp <A-p>
" Clear search highlighting
nnoremap <leader>/ :nohls<return><esc>
" Find/Open file
nmap <leader>of :action GotoFile<CR>
nmap <leader>or :action RecentFiles<CR>

View File

@@ -1594,10 +1594,10 @@
# If p10k is already loaded, reload configuration.
# This works even with POWERLEVEL9K_DISABLE_HOT_RELOAD=true.
(( ! $+functions[p10k] )) || p10k reload
}
}
# Tell `p10k configure` which file it should overwrite.
typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a}
# Tell `p10k configure` which file it should overwrite.
typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a}
(( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]}
'builtin' 'unset' 'p10k_config_opts'
(( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]}
'builtin' 'unset' 'p10k_config_opts'

View File

@@ -25,6 +25,3 @@ fi
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
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-=i
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
set shiftwidth=4 tabstop=4 softtabstop=4 expandtab smarttab
set autoindent smartindent breakindent
syntax on " syntax highlighting.
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 ls=2 " Show a status line
set wrap " Wrap text
set wildmenu " Makes the ex command mode autocomplete paths with Tab
set number " Show line numbers
set ruler
set relativenumber " Relative line numbers
@@ -39,11 +42,10 @@ set signcolumn=yes
set scrolloff=5
set isfname+={,},@-@
set updatetime=50
" Enable undofile and save them in ~/.vim/undo
set undofile " Enable undofiles
set undodir=$HOME/.vim/undo// " Save in each project's root
set directory^=$HOME/.vim/swap// " All swap files at the one place please
set noswapfile
set undofile
set undolevels=10000
set undoreload=100000
" 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.
@@ -56,8 +58,8 @@ set incsearch hlsearch ignorecase smartcase
hi Comment guifg=#5C6370 ctermfg=50 cterm=italic
" Highlight and remove trailing blank spaces on save
match ExtraWhitespace /\s\+$/
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
autocmd BufWritePre * %s/\s\+$//e
" Vim is based on Vi. Setting `nocompatible` switches from the default
@@ -87,3 +89,6 @@ if !has('gui_running')
set termguicolors
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
" Changes the pwd and opens the VCS root
nnoremap <leader>e :tcd %:h<CR> :NERDTreeToggleVCS<CR>
let g:NERDTreeShowHidden = 1
let g:NERDTreeWinSize = 25
" <ctrl-q> to save everything and quit Neovim
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
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
dir_size(){

View File

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