commit 844ad973d203724bf0d08e9dfff17b90184e77f6
parent 02c8a8a137dfd23effb9fa0ed7e777ba59a71d31
Author: Bharatvaj <bharatvaj@yahoo.com>
Date: Sat, 2 Oct 2021 20:01:07 +0530
Merge branch 'base' of https://github.com/bharatvaj/dotfiles into termux
Diffstat:
12 files changed, 94 insertions(+), 42 deletions(-)
diff --git a/.bash_profile b/.bash_profile
@@ -4,7 +4,7 @@
set -o vi
[ -f ~/.profile ] && . ~/.profile
-[ -f ~/.personal/config ] && . ~/.personal/config
+[ -f "${XDG_DATA_HOME}/personal/config" ] && . "${XDG_DATA_HOME}/personal/config"
[ -f "${XDG_CONFIG_HOME}/bash/bashrc" ] && . "${XDG_CONFIG_HOME}"/bash/bashrc
# Zoho
diff --git a/.config/.gitignore b/.config/.gitignore
@@ -3,13 +3,13 @@
!.gitignore
!alacritty/
-!alacritty/*
+!alacritty/**
!bash/
-!bash/*
+!bash/**
!i3
!nvim
!vim/
-!vim/*
+!vim/**
!X11
!wgetrc
!user-dirs.dirs
diff --git a/.config/bash/plugin/git b/.config/bash/plugin/git
@@ -25,7 +25,6 @@ alias gmc='git merge --continue'
alias gp='git pull'
alias gpr='git pull --rebase'
alias gr='git rebase'
-alias gs='git status'
alias gss='git status --short'
alias gst='git stash'
alias gsta='git stash apply'
diff --git a/.config/vim/keybindings/keybindings.vim b/.config/vim/keybindings/keybindings.vim
@@ -0,0 +1,10 @@
+" General keybindings
+nnoremap <leader>t :tabnew<cr>
+nnoremap <leader>p :Rg<cr>
+
+" Plugin keybindings
+source $XDG_CONFIG_HOME/vim/keybindings/vimspector.vim
+source $XDG_CONFIG_HOME/vim/keybindings/markdown.vim
+
+" Development keybindings
+source $XDG_CONFIG_HOME/vim/keybindings/rust.vim
diff --git a/.config/vim/keybindings/markdown.vim b/.config/vim/keybindings/markdown.vim
@@ -0,0 +1,4 @@
+autocmd FileType markdown set cursorline
+
+" Hide and format markdown elements like **bold**
+autocmd FileType markdown set conceallevel=2
diff --git a/.config/vim/keybindings/rust.vim b/.config/vim/keybindings/rust.vim
@@ -0,0 +1,2 @@
+nnoremap <leader>cb :Cargo build<cr>
+nnoremap <leader>cr :Cargo run<cr>
diff --git a/.config/vim/keybindings/vimspector.vim b/.config/vim/keybindings/vimspector.vim
@@ -0,0 +1,25 @@
+fun! GotoWindow(id)
+ call win_gotoid(a:id)
+endfun
+
+" Debugger remaps
+nnoremap <leader>dd :call vimspector#Launch()<CR>
+nnoremap <leader>dc :call GotoWindow(g:vimspector_session_windows.code)<CR>
+nnoremap <leader>dt :call GotoWindow(g:vimspector_session_windows.tagpage)<CR>
+nnoremap <leader>dv :call GotoWindow(g:vimspector_session_windows.variables)<CR>
+nnoremap <leader>dw :call GotoWindow(g:vimspector_session_windows.watches)<CR>
+nnoremap <leader>ds :call GotoWindow(g:vimspector_session_windows.stack_trace)<CR>
+nnoremap <leader>do :call GotoWindow(g:vimspector_session_windows.output)<CR>
+nnoremap <leader>de :call vimspector#Reset()<CR>
+
+nnoremap <leader>dtcb :call vimspector#CleanLineBreakpoint()<CR>
+
+nmap <leader>dl <Plug>VimspectorStepInto
+nmap <leader>dj <Plug>VimspectorStepOver
+nmap <leader>dk <Plug>VimspectorStepOut
+nmap <leader>d_ <Plug>VimspectorRestart
+nnoremap <leader>d<space> :call vimspector#Continue()<CR>
+
+nmap <leader>drc <Plug>VimspectorRunToCursor
+nmap <leader>dbp <Plug>VimspectorToggleBreakpoint
+nmap <leader>dcbp <Plug>VimspectorToggleConditionalBreakpoint
diff --git a/.config/vim/plugin/development.vim b/.config/vim/plugin/development.vim
@@ -0,0 +1,7 @@
+Plug 'editorconfig/editorconfig-vim'
+Plug 'cdelledonne/vim-cmake'
+if has('nvim')
+ Plug 'puremourning/vimspector'
+endif
+Plug 'vim-syntastic/syntastic'
+Plug 'rust-lang/rust.vim'
diff --git a/.config/vim/plugin/plugin.vim b/.config/vim/plugin/plugin.vim
@@ -0,0 +1,26 @@
+" Plugin Management
+function DownloadPlug()
+ 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'
+ PlugInstall --sync | source $MYVIMRC
+ endif
+endfunction
+
+call plug#begin($XDG_DATA_HOME."/vim/plugged")
+ Plug 'tpope/vim-commentary'
+ Plug 'tpope/vim-surround'
+ Plug 'itchyny/lightline.vim'
+ Plug 'tpope/vim-fugitive'
+ Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
+ Plug 'junegunn/fzf.vim'
+ source $XDG_CONFIG_HOME/vim/plugin/development.vim
+call plug#end()
+
+" Plugin Keybindings
+
+" fzf
+nmap <leader>F :GFiles<cr>
+nmap <leader>f :Files<cr>
+
+nnoremap <leader>cc :ChecklistToggleCheckbox<cr>
diff --git a/.config/vim/vimrc b/.config/vim/vimrc
@@ -61,35 +61,9 @@ for key in ['<Up>', '<Down>', '<Left>', '<Right>']
exec 'cnoremap' key '<Nop>'
endfor
-" Plugin Management
-"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 'tpope/vim-fugitive'
- Plug 'tpope/vim-surround'
- Plug 'tpope/vim-commentary'
-call plug#end()
-
-" Plugin customizations
-" fzf
-" BUG remove bashism
-" TODO - Files are repeated twice in some cases
-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 :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>
-nnoremap <leader>cc :ChecklistToggleCheckbox<cr>
-
-" Theming Begin
-" Theming End
+" Plugins
+source $XDG_CONFIG_HOME/vim/plugin/plugin.vim
+
+" Keybindings
+source $XDG_CONFIG_HOME/vim/keybindings/keybindings.vim
+
diff --git a/.local/bin/jrnl b/.local/bin/jrnl
@@ -1,7 +1,11 @@
#!/bin/sh
- jrnl_path="${XDG_DATA_HOME}/notes/content"
+ jrnl_path="${XDG_DATA_HOME}/notes"
-# TODO if ranger is not found, cd into that dir
-[ -d "${jrnl_path}" ] && ranger "${jrnl_path}"
+if [ -d "${jrnl_path}" ]; then
+ ranger "${jrnl_path}"
+else
+ cd "${jrnl_path}"
+ vim "$(fzf --preview 'cat {}')"
+fi
diff --git a/.profile b/.profile
@@ -17,8 +17,7 @@ export PSQL_HISTORY="$XDG_CACHE_HOME/pg/psql_history"
export PGPASSFILE="$XDG_CONFIG_HOME/pg/pgpass"
export PGSERVICEFILE="$XDG_CONFIG_HOME/pg/pg_service.conf"
export RUSTUP_HOME="$XDG_DATA_HOME"/rustup
-export TASKRC="${XDG_CONFIG_HOME}/task/taskrc"
-export TASKDATA="${XDG_DATA_HOME}/task"
+export TASKRC="$XDG_CONFIG_HOME/task/taskrc"
export HISTFILE="$XDG_DATA_HOME"/bash/history
export XINITRC="$XDG_CONFIG_HOME"/X11/xinitrc
export XSERVERRC="$XDG_CONFIG_HOME"/X11/xserverrc
@@ -26,6 +25,8 @@ 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
+export DOCKER_CONFIG="$XDG_CONFIG_HOME"/docker
+export MACHINE_STORAGE_PATH="$XDG_DATA_HOME"/docker-machine
# Setup editor
export VISUAL=vim