commit 41cf91ae9e87eb6e983571f211624ba5a17cc909
parent 5775d05a75649ec567286829615fbb7473ec9ab2
Author: Bharatvaj H <bharatvaj@yahoo.com>
Date: Wed, 4 Aug 2021 19:44:02 +0530
Moved .bashrc and .bash_aliases to .config/bash
Added .vimrc regex search functionality
Aliases added for vi and vim, if nvim is found, it will be preferred
Diffstat:
8 files changed, 36 insertions(+), 23 deletions(-)
diff --git a/.bash_aliases b/.bash_aliases
@@ -1,2 +0,0 @@
-alias startx="startx \"$XDG_CONFIG_HOME/X11/xinitrc\" -- \"$XDG_CONFIG_HOME/X11/xserverrc\" vt1"
-alias wget="wget --hsts-file=\"$XDG_CACHE_HOME/wget-hsts\""
diff --git a/.bash_profile b/.bash_profile
@@ -3,8 +3,8 @@
[ -f ~/.profile ] && . ~/.profile
[ -f ~/.personal/config ] && . ~/.personal/config
-[ -f ~/.bashrc ] && . ~/.bashrc
-[ -f ~/.bash_aliases ] && . ~/.bash_aliases
+[ -f "${XDG_CONFIG_HOME}/bash/bashrc" ] && . "${XDG_CONFIG_HOME}"/bash/bashrc
+[ -f "${XDG_CONFIG_HOME}/bash/aliases" ] && . "${XDG_CONFIG_HOME}"/bash/aliases
# Zoho
[ -f ~/.zoho/zoho ] && . ~/.zoho/zoho
diff --git a/.config/.gitignore b/.config/.gitignore
@@ -4,6 +4,8 @@ Ignore everything by default.
!.gitignore
!alacritty/
!alacritty/*
+!bash/
+!bash/*
!i3
!nvim
!vim/
diff --git a/.config/bash/aliases b/.config/bash/aliases
@@ -0,0 +1,7 @@
+which startx >&/dev/null && alias startx="startx \"$XDG_CONFIG_HOME/X11/xinitrc\" -- \"$XDG_CONFIG_HOME/X11/xserverrc\" vt1"
+which wget >&/dev/null && alias wget="wget --hsts-file=\"$XDG_CACHE_HOME/wget-hsts\""
+which nvim >&/dev/null && alias vim="nvim" && alias vi="nvim"
+
+# jrnl
+[ -d "${XDG_DATA_HOME}/notes/content" ] && alias jrnl="ranger \"${XDG_DATA_HOME}/notes/content\""
+
diff --git a/.bashrc b/.config/bash/bashrc
diff --git a/.config/vim/vimrc b/.config/vim/vimrc
@@ -30,6 +30,9 @@ set mouse=a
syntax on
set exrc
+" Disable vim intro message
+set shortmess=I
+
" Search
set hlsearch
set incsearch
@@ -43,34 +46,38 @@ set expandtab
" Netrw customization
let g:netrw_banner = 0
+" Hard vim
+for key in ['<Up>', '<Down>', '<Left>', '<Right>']
+ exec 'noremap' key '<Nop>'
+ exec 'inoremap' key '<Nop>'
+ exec 'cnoremap' key '<Nop>'
+endfor
" Plugin Management
-let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
-if empty(glob(data_dir . '/autoload/plug.vim'))
- silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
- autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
-endif
+"let data_dir = has('nvim') ? stdpath('data') . '/site' : "${XDG_DATA_HOME}/vim"
+"if empty(glob(data_dir . '/autoload/plug.vim'))
+" silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
+" autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
+"endif
call plug#begin($XDG_DATA_HOME."/vim/plugged")
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'cdelledonne/vim-cmake'
Plug 'editorconfig/editorconfig-vim'
- Plug 'vim-airline/vim-airline'
- Plug 'lifepillar/vim-solarized8'
Plug 'tpope/vim-fugitive'
- Plug 'airblade/vim-gitgutter'
+ Plug 'tpope/vim-surround'
call plug#end()
+" Plugin customizations
+" fzf
+command! GFAll call fzf#run(fzf#wrap({'source': "comm <(git ls-files --exclude-standard --cached --cached --recurse-submodules) <(git ls-files --exclude-standard --cached --others) | awk '{$1=$1;print}'"}))
" Plugin Keybindings
-nmap <Leader>f :GFiles<CR>
-nmap <Leader>F :Files<CR>
+nmap <leader>f :GFAll<cr>
+nmap <leader>F :Files<cr>
nnoremap <leader>t :tabnew<cr>
+nnoremap <leader>p :Rg<cr>
+nnoremap <leader>s :source ~/.config/vim/vimrc<cr>
" Theming Begin
-" Git Gutter
-highlight GitGutterAdd ctermfg=green
-highlight GitGutterChange ctermfg=yellow
-highlight GitGutterDelete ctermfg=red
-highlight GitGutterChangeDelete ctermfg=yellow
" Theming End
diff --git a/.gitignore b/.gitignore
@@ -8,12 +8,9 @@
!.profile
# Bash
-!.bashrc
-!.bash_local
+!.bash_profile
!.bash_logout
-!.bash_aliases
# Config
!.config/
-
diff --git a/.profile b/.profile
@@ -22,7 +22,9 @@ export XSERVERRC="$XDG_CONFIG_HOME"/X11/xserverrc
export XAUTHORITY="$XDG_RUNTIME_DIR"/Xauthority
export ATOM_HOME="$XDG_DATA_HOME"/atom
export WGETRC="$XDG_CONFIG_HOME/wgetrc"
+export SCREENRC="$XDG_CONFIG_HOME"/screen/screenrc
# Setup editor
export EDITOR=vim
+export VISUAL=vim