gitconf/vim/shell: small tweaks
This commit is contained in:
@@ -2,11 +2,11 @@
|
|||||||
name = Marco Thomas
|
name = Marco Thomas
|
||||||
email = rb.ma.tho@gmail.com
|
email = rb.ma.tho@gmail.com
|
||||||
[includeIf "gitdir:~/dev/uni/lrz-gitlab/**"]
|
[includeIf "gitdir:~/dev/uni/lrz-gitlab/**"]
|
||||||
path = "~/dev/uni/lrz-gitlab/.gitconfig"
|
path = "~/dev/lrz-gitlab/.gitconfig"
|
||||||
[alias]
|
[alias]
|
||||||
a = add
|
a = add
|
||||||
aa = add .
|
aa = add .
|
||||||
b = blame -L
|
bl = blame
|
||||||
br = branch
|
br = branch
|
||||||
c = commit -v
|
c = commit -v
|
||||||
ca = commit -v --amend
|
ca = commit -v --amend
|
||||||
@@ -16,11 +16,12 @@
|
|||||||
lg = log --oneline --decorate --graph
|
lg = log --oneline --decorate --graph
|
||||||
lgp = lg -p
|
lgp = lg -p
|
||||||
pl = pull --rebase
|
pl = pull --rebase
|
||||||
|
plm = pull
|
||||||
|
plm = pull
|
||||||
ps = push
|
ps = push
|
||||||
r = rebase
|
r = rebase
|
||||||
sh = show
|
sh = show
|
||||||
st = status
|
st = status
|
||||||
u = pull --rebase
|
|
||||||
yeet = push
|
yeet = push
|
||||||
yoink = pull
|
yoink = pull
|
||||||
[blame]
|
[blame]
|
||||||
|
|||||||
@@ -18,20 +18,6 @@ NEWLINE=$'\n'
|
|||||||
export PROMPT="${HOSTN}${DIR}${GIT}${NEWLINE}${ICON}%{$reset_color%} "
|
export PROMPT="${HOSTN}${DIR}${GIT}${NEWLINE}${ICON}%{$reset_color%} "
|
||||||
zstyle ':vcs_info:git:*' formats ' (%b )'
|
zstyle ':vcs_info:git:*' formats ' (%b )'
|
||||||
|
|
||||||
# show info in title bar
|
|
||||||
case $TERM in
|
|
||||||
(*xterm* | rxvt | alacritty)
|
|
||||||
# This is seen when the shell prompts for input.
|
|
||||||
function precmd {
|
|
||||||
print -Pn "\e]0;%m: %~\a"
|
|
||||||
}
|
|
||||||
# This is seen while the shell waits for a command to complete.
|
|
||||||
function preexec {
|
|
||||||
printf "\033]0;$(hostname): %s\a" "$1"
|
|
||||||
}
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# ============================== Completion
|
# ============================== Completion
|
||||||
unsetopt menu_complete # do not autoselect the first completion entry
|
unsetopt menu_complete # do not autoselect the first completion entry
|
||||||
unsetopt flowcontrol
|
unsetopt flowcontrol
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
let mapleader = "\<Space>"
|
let mapleader = "\<Space>"
|
||||||
|
|
||||||
" ============================== vim-plug
|
" ============================== vim-plug
|
||||||
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
|
let data_dir = '~/.vim'
|
||||||
if empty(glob(data_dir . '/autoload/plug.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'
|
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 ~/.vimrc
|
autocmd VimEnter * PlugInstall --sync | source ~/.vimrc
|
||||||
@@ -16,6 +16,7 @@ call plug#begin()
|
|||||||
Plug 'tpope/vim-sleuth' " heuristic file indendation
|
Plug 'tpope/vim-sleuth' " heuristic file indendation
|
||||||
Plug 'jiangmiao/auto-pairs' " pair completion
|
Plug 'jiangmiao/auto-pairs' " pair completion
|
||||||
Plug 'tpope/vim-fugitive' " git wrapper
|
Plug 'tpope/vim-fugitive' " git wrapper
|
||||||
|
Plug 'mhinz/vim-signify' " show lines changed
|
||||||
Plug 'tpope/vim-commentary' " DWIM comments
|
Plug 'tpope/vim-commentary' " DWIM comments
|
||||||
|
|
||||||
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
||||||
@@ -33,6 +34,7 @@ if has('linux')
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
call plug#end()
|
call plug#end()
|
||||||
|
|
||||||
" ============================== Colors
|
" ============================== Colors
|
||||||
syntax on
|
syntax on
|
||||||
set background=light
|
set background=light
|
||||||
@@ -66,6 +68,7 @@ set wildmenu " autocomplete :e
|
|||||||
set scrolloff=5 " minimum lines above or below the cursor
|
set scrolloff=5 " minimum lines above or below the cursor
|
||||||
|
|
||||||
let g:ctrlp_show_hidden = 1 " show hidden files in ctrlp menus
|
let g:ctrlp_show_hidden = 1 " show hidden files in ctrlp menus
|
||||||
|
let g:fzf_preview_window = ['down,50%', 'ctrl-/']
|
||||||
|
|
||||||
" ============================== Statusline
|
" ============================== Statusline
|
||||||
let g:airline_powerline_fonts = 1
|
let g:airline_powerline_fonts = 1
|
||||||
@@ -116,18 +119,21 @@ let g:netrw_liststyle = 3 " Tree-like structure
|
|||||||
let g:netrw_banner = 0 " Remove useless banner at the top of netrw
|
let g:netrw_banner = 0 " Remove useless banner at the top of netrw
|
||||||
|
|
||||||
" ============================== Macros and Mappings
|
" ============================== Macros and Mappings
|
||||||
" file interaction
|
|
||||||
let g:fzf_preview_window = ['down,50%', 'ctrl-/']
|
" im a lazy brick
|
||||||
|
cabbrev g Git
|
||||||
|
|
||||||
|
" search git tracked files via git-ls-files(1)
|
||||||
|
map <C-p> :GFiles<CR>
|
||||||
|
|
||||||
|
" search in git tracked files with git-grep(1)
|
||||||
command! -bang -nargs=* GGrep
|
command! -bang -nargs=* GGrep
|
||||||
\ call fzf#vim#grep(
|
\ call fzf#vim#grep(
|
||||||
\ 'git grep --line-number -- '.shellescape(<q-args>), 0,
|
\ 'git grep --line-number -- '.shellescape(<q-args>), 0,
|
||||||
\ fzf#vim#with_preview(), <bang>0)
|
\ fzf#vim#with_preview(), <bang>0)
|
||||||
|
|
||||||
map <C-p> :GFiles<CR>
|
|
||||||
map <C-f> :GGrep
|
map <C-f> :GGrep
|
||||||
|
|
||||||
cabbrev g Git
|
" kill whitespaces fast and efficient
|
||||||
|
|
||||||
fun! TrimWhitespace()
|
fun! TrimWhitespace()
|
||||||
let l:save = winsaveview()
|
let l:save = winsaveview()
|
||||||
keeppatterns %s/\s\+$//e
|
keeppatterns %s/\s\+$//e
|
||||||
@@ -135,18 +141,24 @@ fun! TrimWhitespace()
|
|||||||
endfun
|
endfun
|
||||||
noremap <leader>ws :call TrimWhitespace()<CR>
|
noremap <leader>ws :call TrimWhitespace()<CR>
|
||||||
|
|
||||||
|
" sometimes lsp discards message too quickly
|
||||||
map <C-M> :messages<CR>
|
map <C-M> :messages<CR>
|
||||||
|
|
||||||
|
" comment DWIM
|
||||||
map <C-_> :Commentary<CR>
|
map <C-_> :Commentary<CR>
|
||||||
|
|
||||||
|
" clear search highlighting faster
|
||||||
|
map <esc> :noh <CR>
|
||||||
|
|
||||||
" ============================== LSP
|
" ============================== LSP
|
||||||
if has('linux')
|
if has('linux')
|
||||||
set hidden
|
set hidden
|
||||||
let g:LanguageClient_serverCommands = {
|
let g:LanguageClient_serverCommands = {
|
||||||
\ 'rust': ['~/.cargo/bin/rust-analyzer'],
|
\ 'rust': ['rust-analyzer'],
|
||||||
\ 'python': ['/usr/bin/pylsp'],
|
\ 'python': ['pylsp'],
|
||||||
\ 'c': ['/usr/bin/clangd'],
|
\ 'c': ['clangd'],
|
||||||
\ 'cpp': ['/usr/bin/clangd'],
|
\ 'cpp': ['clangd'],
|
||||||
\ 'yaml': ['~/.local/bin/yaml-lsp'],
|
\ 'yaml': ['yaml-lsp'],
|
||||||
\ }
|
\ }
|
||||||
|
|
||||||
nnoremap <C-l> :call LanguageClient_contextMenu()<CR>
|
nnoremap <C-l> :call LanguageClient_contextMenu()<CR>
|
||||||
|
|||||||
Reference in New Issue
Block a user