xdg config home
This commit is contained in:
parent
27b64961ed
commit
6b503255b7
119
home/.vimrc
119
home/.vimrc
|
@ -1,40 +1,52 @@
|
||||||
|
" GENERAL CONFIGS ----------------------------------------------------------------------------------
|
||||||
syntax on " syntax highlighting
|
syntax on " syntax highlighting
|
||||||
|
|
||||||
set nocompatible " disable compatibility to old-time vi
|
set nocompatible " disable compatibility to old-time vi
|
||||||
set mouse=v " middle-click paste with
|
|
||||||
set number
|
set number
|
||||||
set nocompatible
|
set nocompatible
|
||||||
set hlsearch " highlight search
|
set hlsearch " highlight search
|
||||||
set incsearch " incremental search
|
set incsearch " incremental search
|
||||||
set tabstop=4 " number of columns occupied by a tab
|
set tabstop=4 " number of columns occupied by a tab
|
||||||
set softtabstop=4 " see multiple spaces as tabstops so <BS> does the right thing
|
set softtabstop=4 " see multiple spaces as tab stops so <BS> does the right thing
|
||||||
set expandtab " converts tabs to white space
|
set expandtab " converts tabs to white space
|
||||||
set shiftwidth=4 " width for autoindents
|
set shiftwidth=4 " width for auto indents
|
||||||
set autoindent " indent a new line the same amount as the line just typed
|
set autoindent " indent a new line the same amount as the line just typed
|
||||||
set number " add line numbers
|
set number " add line numbers
|
||||||
set wildmode=longest,list " get bash-like tab completions
|
set wildmode=longest,list " get bash-like tab completions
|
||||||
set cc=100 " set an 100 column border for good coding style
|
set cc=100 " set an 100 column border for good coding style
|
||||||
set mouse=a " enable mouse click
|
set mouse=a " enable mouse for help file editing and hitting prompts
|
||||||
set cursorline " highlight current cursorline
|
set cursorline " highlight current cursor line
|
||||||
set ttyfast " Speed up scrolling in Vim
|
set ttyfast " Speed up scrolling in Vim
|
||||||
set fdm=indent " foldingmethod syntax
|
set fdm=indent " folding method syntax
|
||||||
set foldlevel=10 " only fold when a certain complexity is reached by default. This applies only at startup.
|
set foldlevel=10 " only fold when a certain complexity is reached by default.
|
||||||
"set spell " enable spell check (may need to download language package)
|
" This applies only at startup.
|
||||||
set timeout timeoutlen=400
|
set numberwidth=4 " How much space the line numbers should take
|
||||||
|
set signcolumn=yes " Show extra icons in the line numbers (like git marks, errors)
|
||||||
|
set timeout timeoutlen=400 " How long to wait for non prefix free hotkey melodies
|
||||||
set ttimeoutlen=0
|
set ttimeoutlen=0
|
||||||
|
|
||||||
" Avoid showing message extra message when using completion"
|
" Avoid showing message extra message when using completion
|
||||||
set shortmess+=c
|
set shortmess+=c
|
||||||
" set timeout to wait for shortcuts with a prefix
|
|
||||||
|
"allow auto-indenting depending on file type
|
||||||
|
filetype plugin indent on
|
||||||
|
filetype plugin on
|
||||||
|
|
||||||
|
|
||||||
|
let g:indentLine_char = '│'
|
||||||
|
|
||||||
|
" HOTKEYS ------------------------------------------------------------------------------------------
|
||||||
|
" add lines with double o
|
||||||
noremap oo o<ESC>
|
noremap oo o<ESC>
|
||||||
noremap OO O<ESC>
|
noremap OO O<ESC>
|
||||||
|
|
||||||
" H and L for end and beginning
|
" H and L for end and beginning
|
||||||
nmap H ^
|
nmap H ^
|
||||||
nmap L $
|
nmap L $
|
||||||
|
vmap H ^
|
||||||
|
vmap L $
|
||||||
|
|
||||||
" usefull functions for arrow keys
|
" useful functions for arrow keys
|
||||||
" (and force the user to use hjkl)
|
" (and force the user to use `hjkl`)
|
||||||
|
|
||||||
" right/left to add/remove a tab in the beginning of the line.
|
" right/left to add/remove a tab in the beginning of the line.
|
||||||
nmap <Left> <<
|
nmap <Left> <<
|
||||||
|
@ -44,13 +56,19 @@ vmap <Left> <gv
|
||||||
vmap <Right> >gv
|
vmap <Right> >gv
|
||||||
|
|
||||||
" up and down move lines up and down
|
" up and down move lines up and down
|
||||||
nmap <Up> :m -1<CR>
|
nmap <Up> :m -2<CR>
|
||||||
nmap <Down> :m +1<CR>
|
nmap <Down> :m +1<CR>
|
||||||
" same for visual mode (plus reselecting stuff for visual mode)
|
" same for visual mode (plus reselecting stuff for visual mode)
|
||||||
vmap <Up> :m -1<CR>
|
vmap <Up> :m -2<CR>
|
||||||
vmap <Down> :m +1<CR>
|
vmap <Down> :m +1<CR>
|
||||||
|
|
||||||
" hit f3 to toggle search highlighting"
|
" resize windows
|
||||||
|
nnoremap <C-Left> :vertical resize -1<CR>
|
||||||
|
nnoremap <C-Right> :vertical resize +1<CR>
|
||||||
|
nnoremap <C-Up> :resize -1<CR>
|
||||||
|
nnoremap <C-Down> :resize +1<CR>
|
||||||
|
|
||||||
|
" hit F3 to toggle search highlighting"
|
||||||
nnoremap <F3> :set hlsearch!<CR>
|
nnoremap <F3> :set hlsearch!<CR>
|
||||||
|
|
||||||
nnoremap <SPACE> <Nop>
|
nnoremap <SPACE> <Nop>
|
||||||
|
@ -58,7 +76,7 @@ let mapleader=" "
|
||||||
map <leader>t :echo "leader tested!"<CR>
|
map <leader>t :echo "leader tested!"<CR>
|
||||||
map <leader>h :noh<CR>
|
map <leader>h :noh<CR>
|
||||||
|
|
||||||
" copy to wayland clipboard when leader is used. (note, install gvim for this)
|
" copy to Wayland clipboard when leader is used. (note, install gvim for this)
|
||||||
vnoremap <leader>wy y :call system("wl-copy", @")<CR>
|
vnoremap <leader>wy y :call system("wl-copy", @")<CR>
|
||||||
nnoremap <leader>wY Y :call system("wl-copy", @")<CR>
|
nnoremap <leader>wY Y :call system("wl-copy", @")<CR>
|
||||||
nnoremap <leader>wy y :call system("wl-copy", @")<CR>
|
nnoremap <leader>wy y :call system("wl-copy", @")<CR>
|
||||||
|
@ -70,31 +88,64 @@ nnoremap <leader>Y "+Y
|
||||||
nnoremap <leader>y "+y
|
nnoremap <leader>y "+y
|
||||||
nnoremap <leader>yy "+yy
|
nnoremap <leader>yy "+yy
|
||||||
|
|
||||||
" dont write the pastet upon stuff in visual mode into the register
|
" don't write the pasted upon stuff in visual mode into the register
|
||||||
vnoremap p pgvy
|
vnoremap p pgvy
|
||||||
|
|
||||||
" open terminal with F12
|
" open terminal with F12
|
||||||
nnoremap <F12> :terminal<CR>
|
nnoremap <F12> :terminal<CR>
|
||||||
|
|
||||||
" automatically set closed braces aswell when making opened ones.
|
|
||||||
"inoremap " ""<left>
|
|
||||||
"inoremap ' ''<left>
|
|
||||||
"inoremap ( ()<left>
|
|
||||||
"inoremap [ []<left>
|
|
||||||
"inoremap { {}<left>
|
|
||||||
"inoremap {<CR> {<CR>}<ESC>O
|
|
||||||
"inoremap {;<CR> {<CR>};<ESC>O
|
|
||||||
|
|
||||||
" vsplit with <Leader>, then "
|
" vsplit with <Leader>, then "
|
||||||
map <Leader>" :vsplit<CR>
|
map <Leader>" :vsplit<CR>
|
||||||
|
|
||||||
" split with <Leader>, then %"
|
" split with <Leader>, then %"
|
||||||
map <Leader>% :split<CR>
|
map <Leader>% :split<CR>
|
||||||
|
|
||||||
" enter normal mode from terminal-emulator width <ESC>
|
" join with <leader>j
|
||||||
tnoremap <Esc> <C-\><C-n>
|
nnoremap <leader>j :join<CR>
|
||||||
|
" join up with <leader>J
|
||||||
|
nnoremap <leader>J :move .-2<CR> :join<CR>
|
||||||
|
|
||||||
" :W to write file as root"
|
" split lines with <leader>s
|
||||||
command W :w ! sudo tee %
|
nnoremap <leader>s i<CR><ESC>
|
||||||
" Set completeopt to have a better completion experience"
|
" split lines up with <leader>S
|
||||||
set completeopt=menuone,noinsert,noselect
|
nnoremap <leader>S i<CR><ESC> V:m -2<CR>
|
||||||
|
|
||||||
|
" move screen a line up/down with alt U/D
|
||||||
|
nmap <A-u> kzz
|
||||||
|
nmap <A-d> jzz
|
||||||
|
|
||||||
|
" spell checking -----------------------------------------------------------------------------------
|
||||||
|
set spell spelllang=en
|
||||||
|
|
||||||
|
" set a location
|
||||||
|
set spellfile=~/.config/nvim/spell/en.utf-8.add
|
||||||
|
|
||||||
|
" go to last or next misspelled word
|
||||||
|
nnoremap zn ]s
|
||||||
|
nnoremap zN [s
|
||||||
|
|
||||||
|
" same as above but only with bad words (unrecognized)
|
||||||
|
nnoremap Zn ]S
|
||||||
|
nnoremap ZN [S
|
||||||
|
|
||||||
|
" mark correct with zg, mark bad with zw, undo with zug/zuw
|
||||||
|
|
||||||
|
" fancy fzf correct with zc, default is z= but that sucks for qwertz keyboards
|
||||||
|
function! FzfSpellSink(word)
|
||||||
|
exe 'normal! "_ciw'.a:word
|
||||||
|
endfunction
|
||||||
|
function! FzfSpell()
|
||||||
|
let suggestions = spellsuggest(expand("<cword>"))
|
||||||
|
return fzf#run({'source': suggestions, 'sink': function("FzfSpellSink"), 'down': 10 })
|
||||||
|
endfunction
|
||||||
|
nnoremap z<space> :call FzfSpell()<CR>
|
||||||
|
|
||||||
|
" don't make things written as `something` a typo
|
||||||
|
syntax region cBackTickNoSpell start=+`+ end=+`+
|
||||||
|
\ contained containedin=cComment,cCommentL transparent
|
||||||
|
\ contains=@NoSpell
|
||||||
|
|
||||||
|
" don't make lines starting with `//!` a typo (used by rust docs)
|
||||||
|
syntax region cRusDocCommentNoSpell start=+//!+ end='\z1' contained extend
|
||||||
|
\ contained containedin=cComment,cCommentL transparent
|
||||||
|
\ contains=@NoSpell
|
||||||
|
|
|
@ -8,6 +8,7 @@ fi
|
||||||
### ENVVARS
|
### ENVVARS
|
||||||
export EDITOR=nvim
|
export EDITOR=nvim
|
||||||
export editor=nvim
|
export editor=nvim
|
||||||
|
export XDG_CONFIG_HOME=~/.config
|
||||||
|
|
||||||
# configure `time` format
|
# configure `time` format
|
||||||
TIMEFMT=$'\nreal\t%E\nuser\t%U\nsys\t%S\ncpu\t%P'
|
TIMEFMT=$'\nreal\t%E\nuser\t%U\nsys\t%S\ncpu\t%P'
|
||||||
|
|
|
@ -9,6 +9,7 @@ fi
|
||||||
export PATH=/usr/local/sbin:/usr/sbin/:/usr/local/bin:/usr/bin:/var/lib/flatpak/exports/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:~/.local/bin:~/.cargo/bin
|
export PATH=/usr/local/sbin:/usr/sbin/:/usr/local/bin:/usr/bin:/var/lib/flatpak/exports/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:~/.local/bin:~/.cargo/bin
|
||||||
export EDITOR=nvim
|
export EDITOR=nvim
|
||||||
export editor=nvim
|
export editor=nvim
|
||||||
|
export XDG_CONFIG_HOME=~/.config
|
||||||
|
|
||||||
# configure `time` format
|
# configure `time` format
|
||||||
TIMEFMT=$'\nreal\t%E\nuser\t%U\nsys\t%S\ncpu\t%P'
|
TIMEFMT=$'\nreal\t%E\nuser\t%U\nsys\t%S\ncpu\t%P'
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
export PATH=/usr/local/sbin:/usr/sbin/:/usr/local/bin:/usr/bin:~/.local/bin:~/.cargo/bin
|
export PATH=/usr/local/sbin:/usr/sbin/:/usr/local/bin:/usr/bin:~/.local/bin:~/.cargo/bin
|
||||||
export EDITOR=vim
|
export EDITOR=vim
|
||||||
export editor=vim
|
export editor=vim
|
||||||
|
export XDG_CONFIG_HOME=~/.config
|
||||||
|
|
||||||
# configure `time` format
|
# configure `time` format
|
||||||
TIMEFMT=$'\nreal\t%E\nuser\t%U\nsys\t%S\ncpu\t%P'
|
TIMEFMT=$'\nreal\t%E\nuser\t%U\nsys\t%S\ncpu\t%P'
|
||||||
|
|
|
@ -8,6 +8,7 @@ fi
|
||||||
### ENVVARS
|
### ENVVARS
|
||||||
export PATH=/usr/local/sbin:/usr/sbin/:/usr/local/bin:/usr/bin:/var/lib/flatpak/exports/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:~/.local/bin:~/.cargo/bin
|
export PATH=/usr/local/sbin:/usr/sbin/:/usr/local/bin:/usr/bin:/var/lib/flatpak/exports/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:~/.local/bin:~/.cargo/bin
|
||||||
export EDITOR=nvim
|
export EDITOR=nvim
|
||||||
|
export XDG_CONFIG_HOME=~/.config
|
||||||
export editor=nvim
|
export editor=nvim
|
||||||
|
|
||||||
# configure `time` format
|
# configure `time` format
|
||||||
|
|
|
@ -12,6 +12,8 @@ cp -r $(pwd)/home/.config ~
|
||||||
cp -r $(pwd)/home/.tmux-server.conf ~/.tmux.conf
|
cp -r $(pwd)/home/.tmux-server.conf ~/.tmux.conf
|
||||||
touch ~/.local.zsh
|
touch ~/.local.zsh
|
||||||
|
|
||||||
if [ tail -n 1 ~/.zshrc != "source ~/.zsh-kali/zshrc" ]; then
|
last_line=$(tail -n 1 ~/.zshrc)
|
||||||
|
|
||||||
|
if [ $last_line != "source ~/.zsh-kali/zshrc" ]; then
|
||||||
echo "source ~/.zsh-kali/zshrc" >> ~/.zshrc
|
echo "source ~/.zsh-kali/zshrc" >> ~/.zshrc
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue