dotfiles

Cross platform dotfiles for linux, mac and windows

commit dc27238379e40c8d1b8ca94fe4a152d5b52f5977
parent 17320049b6ab7a5185e347ecc54761673229e8ef
Author: Bharatvaj <bharatvaj@yahoo.com>
Date: Wed, 2 Feb 2022 15:04:17 +0530

Merge branch 'base' of github.com:bharatvaj/dotfiles into macos
28 files changed, 76 insertions(+), 65 deletions(-)
diff --git a/.config/.gitignore b/.config/.gitignore
@@ -14,10 +14,11 @@
 !lynx/lynx.cfg
 !lynx/lynx.lss
 !nvim
+!nvim/**
 !sh/
 !sh/**
 !tmux/
-!tmux/*
+!tmux/tmux.conf
 !user-dirs.dirs
 !vim/
 !vim/**
diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua
@@ -0,0 +1,12 @@
+vim.g.mapleader = ' '
+local set = vim.opt
+
+local map = require("utils").map
+
+map("n", "<Leader>ww", ":w<CR>", { silent = true })
+map("n", "<Leader>wq", ":wq<CR>", { silent = true })
+map("n", "<Leader>qq", ":q<CR>", { silent = true })
+map("n", "<CR>", ":noh<CR>", { silent = true })
+
+
+set.tabstop=4
diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim
@@ -1,3 +0,0 @@
-set runtimepath^=$XDG_CONFIG_HOME/vim/.vimrc runtimepath+=$XDG_CONFIG_HOME/vim/after
-let &packpath=&runtimepath
-" source $XDG_CONFIG_HOME/vim/.vimrc
diff --git a/.config/nvim/utils.lua b/.config/nvim/utils.lua
@@ -0,0 +1,11 @@
+local M = {}
+
+function M.map(mode, lhs, rhs, opts)
+    local options = { noremap = true }
+    if opts then
+        options = vim.tbl_extend("force", options, opts)
+    end
+    vim.api.nvim_set_keymap(mode, lhs, rhs, options)
+end
+
+return M
diff --git a/.config/vim/hyper.vim b/.config/vim/hyper.vim
@@ -0,0 +1,4 @@
+hi LineNr guifg=DarkGray ctermfg=DarkGray
+hi LineNrAbove guifg=LightGray ctermfg=LightGray
+hi LineNrBelow guifg=LightGray ctermfg=LightGray
+
diff --git a/.config/vim/keybindings/keybindings.vim b/.config/vim/keybindings/keybindings.vim
@@ -2,6 +2,7 @@
 nnoremap <leader>t :tabnew<cr>
 nnoremap <leader>p :Rg<cr>
 nnoremap <leader>f :find 
+nnoremap <Leader>l :ls<CR>:b<space>
 nmap <leader>F :GFiles<cr>
 
 " Buffer Creation

@@ -11,13 +12,17 @@ nnoremap <Leader>s :split<enter>
 " Quick save and write
 nnoremap <leader>wq :wq<cr>
 nnoremap <leader>ww :w<cr>
-nnoremap <leader>q :q<cr>
+nnoremap <leader>qq :q<cr>
 
 nnoremap <CR> :noh<CR><CR>:<backspace>
 
 " Plugin keybindings
-source $XDG_CONFIG_HOME/vim/keybindings/vimspector.vim
-source $XDG_CONFIG_HOME/vim/keybindings/markdown.vim
+source ~/.config/vim/keybindings/vimspector.vim
+source ~/.config/vim/keybindings/markdown.vim
 
 " Development keybindings
-source $XDG_CONFIG_HOME/vim/keybindings/rust.vim
+" TODO Have a default build hotkey keybinding, maybe bb,br?
+" And make it based on the project
+" Make it as a filetype plugin. This should cover most cases.
+nnoremap <leader>cb :Cargo build<cr>
+nnoremap <leader>cr :Cargo run<cr>
diff --git a/.config/vim/keybindings/rust.vim b/.config/vim/keybindings/rust.vim
@@ -1,2 +1 @@
-nnoremap <leader>cb :Cargo build<cr>
-nnoremap <leader>cr :Cargo run<cr>
+
diff --git a/.config/vim/plugin/development.vim b/.config/vim/plugin/development.vim
@@ -1,13 +0,0 @@
-Plug 'editorconfig/editorconfig-vim'
-Plug 'cdelledonne/vim-cmake'
-Plug 'vim-syntastic/syntastic'
-Plug 'rust-lang/rust.vim'
-if has('python')
-	" Enable if required, manually
-    "Plug 'puremourning/vimspector'
-endif
-"TODO add windows check
-if has('win32')
-	Plug 'heaths/vim-msbuild'
-endif
-Plug 'mattn/emmet-vim'
diff --git a/.config/vim/plugin/plugin.vim b/.config/vim/plugin/plugin.vim
@@ -1,35 +1,2 @@
-" 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 'tpope/vim-fugitive'
-	Plug 'tpope/vim-repeat'
-	Plug 'tpope/vim-unimpaired'
-	Plug 'tommcdo/vim-ninja-feet'
-	Plug 'ap/vim-css-color'
-	Plug 'justinmk/vim-sneak'
-	Plug 'easymotion/vim-easymotion'
-	Plug 'kana/vim-textobj-user' | Plug 'whatyouhide/vim-textobj-xmlattr'
-	Plug 'msanders/snipmate.vim'
-	Plug 'sainnhe/gruvbox-material'
-	Plug 'ntpeters/vim-better-whitespace'
-	Plug 'lpinilla/vim-codepainter'
-	Plug '907th/vim-auto-save'
-    source $XDG_CONFIG_HOME/vim/plugin/development.vim
-call plug#end()
-
-" Enable auto save only if backups are disabled
-if exists("nowb")
-	let g:auto_save = 1
-endif
-
 " Plugin Keybindings
 nnoremap <leader>cc :ChecklistToggleCheckbox<cr>
diff --git a/.config/vim/vimrc b/.config/vim/vimrc
@@ -1,20 +1,19 @@
 " Use XDG Paths for vim
-set runtimepath^=$XDG_CONFIG_HOME/vim
-set runtimepath+=$XDG_DATA_HOME/vim
-set runtimepath+=$XDG_CONFIG_HOME/vim/after
+set runtimepath^='$XDG_CONFIG_HOME/vim'
+set runtimepath+='$XDG_DATA_HOME/vim'
+set runtimepath+='$XDG_CONFIG_HOME/vim/after'
 
-set packpath^=$XDG_DATA_HOME/vim,$XDG_CONFIG_HOME/vim
-set packpath+=$XDG_CONFIG_HOME/vim/after,$XDG_DATA_HOME/vim/after
+set packpath^=$XDG_DATA_HOME/vim
 
-let g:netrw_home = $XDG_DATA_HOME."/vim"
-call mkdir($XDG_DATA_HOME."/vim/spell", 'p')
+let g:netrw_home = $XDG_DATA_HOME . "/vim"
+call mkdir($XDG_DATA_HOME . "/vim/spell", 'p')
 set viewdir=$XDG_DATA_HOME/vim/view | call mkdir(&viewdir, 'p')
 
 set backupdir=$XDG_CACHE_HOME/vim/backup | call mkdir(&backupdir, 'p')
 set directory=$XDG_CACHE_HOME/vim/swap   | call mkdir(&directory, 'p')
 set undodir=$XDG_CACHE_HOME/vim/undo     | call mkdir(&undodir,   'p')
 
-if !has('nvim') | set viminfofile=$XDG_CACHE_HOME/vim/viminfo | endif
+if !has('nvim') | set viminfofile=$XDG_CACHE_DIR/vim/viminfo | endif
 
 " Line number
 "Adapted from https://jeffkreeftmeijer.com/vim-number/

@@ -84,7 +83,7 @@ hi LineNr ctermbg=Black ctermfg=White
 hi CursorLineNr ctermbg=White ctermfg=Black
 
 " Disable status
-set laststatus=0
+set laststatus=1
 set nowrapscan
 
 " Plugins

@@ -92,3 +91,13 @@ source $XDG_CONFIG_HOME/vim/plugin/plugin.vim
 
 " Keybindings
 source $XDG_CONFIG_HOME/vim/keybindings/keybindings.vim
+
+if has("win32")
+	if executable("pwsh")
+		set shell=pwsh
+		set shellcmdflag=-ExecutionPolicy\ RemoteSigned\ -Command
+		set shellquote=\" 
+		" shellxquote must be a literal space character.
+		set shellxquote=  
+	endif
+endif
diff --git a/.local/share/.gitignore b/.local/share/.gitignore
@@ -0,0 +1,2 @@
+!vim/pack/
+!vim/pack/*
diff --git a/.local/share/vim/pack/development/start/emmet-vim b/.local/share/vim/pack/development/start/emmet-vim
@@ -0,0 +1 @@
+Subproject commit 1b7e460de071b7ed45cae3b5bec47310e7d12ed5
diff --git a/.local/share/vim/pack/development/start/rust.vim b/.local/share/vim/pack/development/start/rust.vim
@@ -0,0 +1 @@
+Subproject commit c06a17151c69b9d61e60a28274932a28fd37c453
diff --git a/.local/share/vim/pack/development/start/vim-cmake b/.local/share/vim/pack/development/start/vim-cmake
@@ -0,0 +1 @@
+Subproject commit 844b85677d52d932432eb115236d9173ebe3664d
diff --git a/.local/share/vim/pack/development/start/vim-msbuild b/.local/share/vim/pack/development/start/vim-msbuild
@@ -0,0 +1 @@
+Subproject commit 4766d9a225c433e7ce2625bcc6263bfd028c4a50
diff --git a/.local/share/vim/pack/general/start/editorconfig-vim b/.local/share/vim/pack/general/start/editorconfig-vim
@@ -0,0 +1 @@
+Subproject commit 3078cd10b28904e57d878c0d0dab42aa0a9fdc89
diff --git a/.local/share/vim/pack/general/start/vim-better-whitespace b/.local/share/vim/pack/general/start/vim-better-whitespace
@@ -0,0 +1 @@
+Subproject commit c5afbe91d29c5e3be81d5125ddcdc276fd1f1322
diff --git a/.local/share/vim/pack/general/start/vim-codepainter b/.local/share/vim/pack/general/start/vim-codepainter
@@ -0,0 +1 @@
+Subproject commit 1ae0ee4f48e7e196ef90bc84ecbc56cad231e9df
diff --git a/.local/share/vim/pack/general/start/vim-commentary b/.local/share/vim/pack/general/start/vim-commentary
@@ -0,0 +1 @@
+Subproject commit 349340debb34f6302931f0eb7139b2c11dfdf427
diff --git a/.local/share/vim/pack/general/start/vim-easymotion b/.local/share/vim/pack/general/start/vim-easymotion
@@ -0,0 +1 @@
+Subproject commit d75d9591e415652b25d9e0a3669355550325263d
diff --git a/.local/share/vim/pack/general/start/vim-fugitive b/.local/share/vim/pack/general/start/vim-fugitive
@@ -0,0 +1 @@
+Subproject commit 6f07d7e6cd23b7a76dc461fdfb1984717d233806
diff --git a/.local/share/vim/pack/general/start/vim-ninja-feet b/.local/share/vim/pack/general/start/vim-ninja-feet
@@ -0,0 +1 @@
+Subproject commit cb9b448dd468a338255aed474e6113ed115612c1
diff --git a/.local/share/vim/pack/general/start/vim-repeat b/.local/share/vim/pack/general/start/vim-repeat
@@ -0,0 +1 @@
+Subproject commit 24afe922e6a05891756ecf331f39a1f6743d3d5a
diff --git a/.local/share/vim/pack/general/start/vim-surround b/.local/share/vim/pack/general/start/vim-surround
@@ -0,0 +1 @@
+Subproject commit f51a26d3710629d031806305b6c8727189cd1935
diff --git a/.local/share/vim/pack/general/start/vim-textobj-user b/.local/share/vim/pack/general/start/vim-textobj-user
@@ -0,0 +1 @@
+Subproject commit 41a675ddbeefd6a93664a4dc52f302fe3086a933
diff --git a/.local/share/vim/pack/general/start/vim-textobj-xmlattr b/.local/share/vim/pack/general/start/vim-textobj-xmlattr
@@ -0,0 +1 @@
+Subproject commit 694a297f1d75fd527e87da9769f3c6519a87ebb1
diff --git a/.local/share/vim/pack/general/start/vim-unimpaired b/.local/share/vim/pack/general/start/vim-unimpaired
@@ -0,0 +1 @@
+Subproject commit e4006d68cd4f390efef935bc09be0ce3bd022e72
diff --git a/.local/share/vim/pack/themes/start/gruvbox-material b/.local/share/vim/pack/themes/start/gruvbox-material
@@ -0,0 +1 @@
+Subproject commit fb27ccbd20cc1eda04e181f22c722977bdf9c934