dotfiles

Cross platform dotfiles for linux, mac and windows
git clone git@getsh.org:dotfiles.git
Log | Files | Refs

commit 757089a1a743ec71b62da1d15f5a3c6e217ebd12
parent dc1bc85c93a92f86c15938258242df26ac3f38e6
Author: Bharatvaj <bharatvaj@yahoo.com>
Date:   Thu, 31 Mar 2022 14:58:01 +0530

Merge pull request #31 from bharatvaj/macos

Vim changes
Diffstat:
M.config/bash/bashrc | 5+++++
M.config/git/config | 2++
M.config/nvim/init.lua | 9++++++++-
D.config/nvim/utils.lua | 11-----------
M.config/sh/aliases | 1+
M.config/tmux/tmux.conf | 8++++++--
M.config/vim/keybindings/keybindings.vim | 16++++++++++++++++
M.config/vim/vimrc | 16+++-------------
M.gitmodules | 6++++++
A.local/share/nvim/pack/general/start/nvim-lspconfig | 1+
A.local/share/vim/pack/general/start/vim-tmux-navigator | 1+
M.profile | 6++++--
12 files changed, 53 insertions(+), 29 deletions(-)

diff --git a/.config/bash/bashrc b/.config/bash/bashrc @@ -4,4 +4,9 @@ PATH_EXPORTS=( "${ESSENTIAL_PATH_EXPORTS[@]}" "${OTHER_PATH_EXPORTS[@]}" ) export PATH="${PATH}:${PATH_EXPORTS[*]}" +[ -f ${XDG_CONFIG_HOME}/bash/autojump.bash ] && ${XDG_CONFIG_HOME}/bash/autojump.bash + +PS1='\w ∆ ' + + [ -f /usr/local/etc/profile.d/autojump.sh ] && . /usr/local/etc/profile.d/autojump.sh diff --git a/.config/git/config b/.config/git/config @@ -4,7 +4,9 @@ ba = branch --all c = commit cm = commit --message + ca = commit --amend co = checkout + con = config d = diff ds = diff --staged ld = log --pretty=format:"%h %ad %s" --date=short --all diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua @@ -1,6 +1,8 @@ vim.g.mapleader = ' ' local set = vim.opt +set.packpath="$XDG_DATA_HOME/nvim" + local map = require("utils").map map("n", "<Leader>ww", ":w<CR>", { silent = true }) @@ -8,5 +10,10 @@ 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 +set.exrc=false + + +require'lspconfig'.pyright.setup{} + +set.shortmess="Iat" diff --git a/.config/nvim/utils.lua b/.config/nvim/utils.lua @@ -1,11 +0,0 @@ -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/sh/aliases b/.config/sh/aliases @@ -21,3 +21,4 @@ mich ifconfig && alias lip="ifconfig | grep -w inet | cut -d ' ' -f2" mich curl && alias gip="curl ifconfig.co" alias '?d'='sr duckduckgo' +alias l=lfcd diff --git a/.config/tmux/tmux.conf b/.config/tmux/tmux.conf @@ -5,8 +5,9 @@ set -g set-titles on # Status bar set -g status-position top +set -g status-justify absolute-centre set -g status-right "" - +set -g status-keys vi bind v split-window -h bind s split-window -v @@ -33,12 +34,14 @@ bind -T copy-mode-vi y send-keys -X copy-selection-and-cancel set-option -g mouse on setw -g mode-keys vi set-option -s set-clipboard off +bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy" bind P paste-buffer # Themes set -g status-bg black set -g status-fg white -set -g window-status-current-style "bg=white,fg=black" +set -g window-status-current-style "bg=black,fg=red" +set -g pane-active-border-style "fg=red" # Smart pane switching with awareness of Vim splits. # See: https://github.com/christoomey/vim-tmux-navigator @@ -59,3 +62,4 @@ bind-key -T copy-mode-vi 'C-j' select-pane -D bind-key -T copy-mode-vi 'C-k' select-pane -U bind-key -T copy-mode-vi 'C-l' select-pane -R bind-key -T copy-mode-vi 'C-\' select-pane -l +bind R source-file ~/.config/tmux/tmux.conf diff --git a/.config/vim/keybindings/keybindings.vim b/.config/vim/keybindings/keybindings.vim @@ -4,6 +4,19 @@ nnoremap <leader>p :Rg<cr> nnoremap <leader>f :find nnoremap <Leader>l :ls<CR>:b<space> nmap <leader>F :GFiles<cr> +nnoremap <leader>co :copen<cr> +nnoremap <leader>g :grep +nnoremap Y y$ + +function! ToggleList() + if &list == "nolist" + set list + else + set nolist + endif +endfunction + +nnoremap <leader>tl :call ToggleList()<CR> " Buffer Creation nnoremap <Leader>v :vsplit<enter> @@ -17,6 +30,9 @@ nnoremap <leader>qq :q<cr> " Run Make nnoremap <leader>bb :make<CR> +" Generate ctags +map <leader>c :!ctags -R -f ./.git/tags .<CR> + nnoremap <CR> :noh<CR><CR>:<backspace> " Plugin keybindings diff --git a/.config/vim/vimrc b/.config/vim/vimrc @@ -25,7 +25,7 @@ augroup numbertoggle augroup END " General -set mouse=a +set mouse= set nocursorline syntax on set exrc @@ -61,18 +61,6 @@ set shiftwidth=4 " Netrw customization let g:netrw_banner = 0 -" Harder vim -" Disable arrow keys -for key in ['<Up>', '<Down>', '<Left>', '<Right>'] - exec 'noremap' key '<Nop>' - exec 'inoremap' key '<Nop>' - exec 'cnoremap' key '<Nop>' -endfor -" Disable h and l -for key in ['h', 'l'] - exec 'noremap' key '<Nop>' -endfor - " Visual Tweaks hi VertSplit term=NONE cterm=NONE gui=NONE @@ -101,3 +89,5 @@ if has("win32") set shellxquote= endif endif + +set path+=** diff --git a/.gitmodules b/.gitmodules @@ -46,3 +46,9 @@ [submodule ".local/share/vim/pack/themes/start/gruvbox-material"] path = .local/share/vim/pack/themes/start/gruvbox-material url = https://git::@github.com/sainnhe/gruvbox-material.git +[submodule ".local/share/vim/pack/general/start/vim-tmux-navigator"] + path = .local/share/vim/pack/general/start/vim-tmux-navigator + url = https://github.com/christoomey/vim-tmux-navigator +[submodule ".local/share/nvim/pack/general/start/nvim-lspconfig"] + path = .local/share/nvim/pack/general/start/nvim-lspconfig + url = https://github.com/neovim/nvim-lspconfig diff --git a/.local/share/nvim/pack/general/start/nvim-lspconfig b/.local/share/nvim/pack/general/start/nvim-lspconfig @@ -0,0 +1 @@ +Subproject commit 54181ddb2709a4cd594e29bf82343c79196ec0c6 diff --git a/.local/share/vim/pack/general/start/vim-tmux-navigator b/.local/share/vim/pack/general/start/vim-tmux-navigator @@ -0,0 +1 @@ +Subproject commit 9ca5bfe5bd274051b5dd796cc150348afc993b80 diff --git a/.profile b/.profile @@ -7,7 +7,9 @@ export XDG_DATA_HOME="$HOME/.local/share" export XDG_CACHE_HOME="$HOME/.cache" # Global programs -export VIMINIT="source $XDG_CONFIG_HOME/vim/vimrc" +export VIMINIT="if !has('nvim') +source $XDG_CONFIG_HOME/vim/vimrc +endif" export LESSHISTFILE=- export LYNX_CFG="$XDG_CONFIG_HOME/lynx/lynx.cfg" export LYNX_LSS="$XDG_CONFIG_HOME/lynx/lynx.lss" @@ -57,7 +59,7 @@ export GEM_SPEC_CACHE="$XDG_CACHE_HOME"/gem HISTTIMEFORMAT="%F %T " # Local executables -export PATH=${PATH}:~/.local/bin +export PATH=${PATH}:${HOME}/.local/bin:${XDG_DATA_HOME}/npm/bin:${XDG_DATA_HOME}/.cargo/bin chance() { # Hit or miss