Merge branch 'master' of github.com:tomru/Dotfiles

This commit is contained in:
Thomas Ruoff
2018-02-07 09:16:57 +01:00
4 changed files with 103 additions and 101 deletions

View File

@@ -21,19 +21,19 @@ URxvt*lineSpace: 0
URxvt*skipBuiltinGlyphs: true URxvt*skipBuiltinGlyphs: true
! Fonts ! Fonts
URxvt*font: xft:Fira Mono:style=Regular:size=11, \ URxvt*font: xft:Hack:style=Regular:size=11, \
xft:Droid Sans Fallback:style=Regular, \ xft:Droid Sans Fallback:style=Regular, \
xft:Droid Sans Japanese:style=Regular, \ xft:Droid Sans Japanese:style=Regular, \
xft:unifont:style=Medium xft:unifont:style=Medium
URxvt*boldFont: xft:Fira Mono:style=Bold:size=11, \ URxvt*boldFont: xft:Hack:style=Bold:size=11, \
xft:Droid Sans Fallback:style=Regular, \ xft:Droid Sans Fallback:style=Regular, \
xft:Droid Sans Japanese:style=Regular, \ xft:Droid Sans Japanese:style=Regular, \
xft:unifont:style=Medium xft:unifont:style=Medium
URxvt*italicFont: xft:Fira Mono:style=Regular:size=11, \ URxvt*italicFont: xft:Hack:style=Regular:size=11, \
xft:Droid Sans Fallback:style=Regular, \ xft:Droid Sans Fallback:style=Regular, \
xft:Droid Sans Japanese:style=Regular, \ xft:Droid Sans Japanese:style=Regular, \
xft:unifont:style=Medium xft:unifont:style=Medium
URxvt*boldItalicFont: xft:Fira Mono:style=Bold:size=11, \ URxvt*boldItalicFont: xft:Hack:style=Bold:size=11, \
xft:Droid Sans Fallback:style=Regular, \ xft:Droid Sans Fallback:style=Regular, \
xft:Droid Sans Japanese:style=Regular, \ xft:Droid Sans Japanese:style=Regular, \
xft:unifont:style=Medium xft:unifont:style=Medium

44
vim/cheetsheet.md Normal file
View File

@@ -0,0 +1,44 @@
# VIM CHEETSHEET
Generel stuff that I need to get into my muscle memory.
* `C-W [hjkl]` - switch to window left, above, below, right
* `C-L` - clear highlight
## yanking
* `"ay` - replace content of register 'a'
* `"Ay` - append to content of register 'a'
* `y` - will put stuff in the default register `""` and `"0`
* `d` - will put stuff just in the default register `""` - so `"0p` will still
paste the last yank
* `3yy` - yank next three lines
* `C-r +` - paste register '+' in insert mode
* `"*` - linux the PRIMARY clipboard, system clipboard on other operating
systems
* `"+` - the system clipboard on all operating systems
## unimpared
* `]b` - :bnext
* `[b` - :bprevious
* `]B` - :bfirst
* `[B` - :blast
## surround
* `cs"'` - changes surrouding " to '
## Grepper
* `<leader>g` - kick off
* without entering anything, takes word under the cursor
## GitGutter
* `]c`, `[c` - jump to next/prev hunk (*c*hange)
* `<leader>hs` - stage hunk
* `<leader>hu` - undo hunk
## Debugging
* `<leader>DD` - start profiling
* `<leader>DP` - pause profiling, output in `profile.log`

140
vimrc
View File

@@ -1,60 +1,55 @@
" vim: set fenc=utf-8 ft=vim fdm=marker fmr={{{,}}}: " vim: set fenc=utf-8 ft=vim fdm=marker fmr={{{,}}}:
" file: ~/.vimrc " author: Thomas Ruoff
" author: Thomas Ruoff (with the help of a myriad others)
" Plugins {{{ " Plugins {{{
call plug#begin('~/.vim/plugged') call plug#begin('~/.vim/plugged')
Plug 'tpope/vim-sensible' Plug 'tpope/vim-sensible'
Plug 'tpope/vim-unimpaired'
Plug 'tpope/vim-surround'
Plug 'vim-scripts/L9' " Plug 'Raimondi/delimitMate'
Plug 'vim-scripts/unimpaired.vim'
Plug 'vim-scripts/surround.vim'
Plug 'vim-scripts/Align'
Plug 'Raimondi/delimitMate'
" project config
Plug 'editorconfig/editorconfig-vim' Plug 'editorconfig/editorconfig-vim'
Plug 'tpope/vim-projectionist' Plug 'tpope/vim-projectionist'
Plug 'maralla/completor.vim', { 'do': 'make js'} " navigating in project
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'mhinz/vim-grepper'
Plug 'ludovicchabant/vim-gutentags' Plug 'ludovicchabant/vim-gutentags'
Plug 'nathanaelkane/vim-indent-guides' " linting
Plug 'w0rp/ale'
" completion
Plug 'maralla/completor.vim', { 'do': 'make js'}
" git related
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-rhubarb'
Plug 'airblade/vim-gitgutter'
" appearence
Plug 'itchyny/lightline.vim'
Plug 'morhetz/gruvbox'
" filetypes
Plug 'sheerun/vim-polyglot'
Plug 'SirVer/ultisnips' Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets' Plug 'honza/vim-snippets'
Plug 'w0rp/ale' " javascript
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-rhubarb'
Plug 'rhysd/conflict-marker.vim'
Plug 'airblade/vim-gitgutter'
Plug 'inside/vim-search-pulse'
Plug 'itchyny/lightline.vim'
Plug 'morhetz/gruvbox'
Plug 'pangloss/vim-javascript' Plug 'pangloss/vim-javascript'
Plug 'marijnh/tern_for_vim', { 'do': 'npm install' } Plug 'marijnh/tern_for_vim', { 'do': 'npm install' }
Plug 'mxw/vim-jsx' Plug 'mxw/vim-jsx'
" previews
Plug 'suan/vim-instant-markdown', { 'for': 'markdown' } Plug 'suan/vim-instant-markdown', { 'for': 'markdown' }
Plug 'xuhdev/vim-latex-live-preview', { 'for': 'tex' } Plug 'xuhdev/vim-latex-live-preview', { 'for': 'tex' }
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } " debug
Plug 'junegunn/fzf.vim'
Plug 'mhinz/vim-grepper'
Plug 'sheerun/vim-polyglot'
Plug 'christoomey/vim-tmux-navigator'
Plug 'tweekmonster/startuptime.vim' Plug 'tweekmonster/startuptime.vim'
" Investigate on custom text object, seems really usefull " Investigate on custom text object, seems really usefull
@@ -66,8 +61,6 @@ call plug#end()
" }}} " }}}
" Basics {{{ " Basics {{{
set nocompatible
set hidden set hidden
set ttyfast set ttyfast
set synmaxcol=512 set synmaxcol=512
@@ -84,6 +77,10 @@ set wildignore+=*.swp,*.bak,*.jpg,*.gif,*.png,*.git,
set splitright set splitright
set splitbelow set splitbelow
" yank delete change and put operations go by default in `"+` register
" so in the systems clipboard accessable by CTRL-V on all OS types
set clipboard=unnamedplus
" set ignorecase " set ignorecase
set infercase set infercase
set smartcase set smartcase
@@ -118,16 +115,19 @@ set secure
" Text Formatting {{{ " Text Formatting {{{
set list set list
set breakindent set breakindent
set showbreak= set showbreak=
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
set textwidth=79 set textwidth=79
set colorcolumn=80 set colorcolumn=80
set nojoinspaces set nojoinspaces
set tabstop=8
set softtabstop=4
set shiftwidth=4
set expandtab
" }}} " }}}
" Folding {{{ " Folding {{{
@@ -151,14 +151,10 @@ set undoreload=10000
" Visual Setting {{{ " Visual Setting {{{
" "
set background=dark
set cursorline set cursorline
colorscheme gruvbox colorscheme gruvbox
set number set number
if exists('+relativenumber')
set relativenumber
endif
" }}} " }}}
" GUI Settings {{{ " GUI Settings {{{
@@ -181,20 +177,6 @@ inoremap jj <ESC>
"" fast saving "" fast saving
nnoremap <leader>w :update<cr> nnoremap <leader>w :update<cr>
"" remove hightlighting
nnoremap <leader><space> :nohls <cr>
"" fast window switching
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
"" open next,prev buffer, cycle
noremap <leader>. :bn<cr>
noremap <leader>m :bp<cr>
noremap <leader>: :b#<cr>
"" delete buffer "" delete buffer
noremap <leader>bd :bd<cr> noremap <leader>bd :bd<cr>
@@ -202,30 +184,14 @@ noremap <leader>bd :bd<cr>
vnoremap > >gv vnoremap > >gv
vnoremap < <gv vnoremap < <gv
"" allow using . with visual mode
vnoremap . :norm.<cr>
"" Visually select the text that was last edited/pasted "" Visually select the text that was last edited/pasted
nnoremap gV `[v`] nnoremap gV `[v`]
"" fast editing of the .vimrc "" fast editing of the .vimrc
nnoremap <silent> <leader>ev :e $MYVIMRC<cr> nnoremap <silent> <leader>ev :e $MYVIMRC<cr>
"" turn on spell checking "" cheetsheet
noremap <leader>spl :setlocal spell!<cr> nnoremap <silent> <leader>ec :e ~/.vim/cheetsheet.md<cr>
"" spell checking shortcuts
noremap <leader>sn ]s
noremap <leader>sp [s
noremap <leader>sa zg
noremap <leader>s? z=
"" toggle states
nnoremap <silent> <leader>hh :set invhlsearch<CR>
nnoremap <silent> <leader>ll :set invlist<CR>
nnoremap <silent> <leader>pp :set invpaste<CR>
nnoremap <silent> <leader>nn :set invnumber<CR>
nnoremap <silent> <leader>ii :set invrelativenumber<CR>
" debugging, use leader-DD to start, do a slow action, then leader-DQ to " debugging, use leader-DD to start, do a slow action, then leader-DQ to
" finish. Your output will be in profile.log " finish. Your output will be in profile.log
@@ -253,8 +219,13 @@ iab xnow <c-r>=strftime("%Y-%m-%d %H:%M")<cr>
let g:EditorConfig_core_mode = 'python_external' let g:EditorConfig_core_mode = 'python_external'
let g:EditorConfig_exclude_patterns = ['fugitive://.*'] let g:EditorConfig_exclude_patterns = ['fugitive://.*']
"" gutentags "" vim-grepper
nnoremap <leader>g :Grepper -tool rg<cr>
let g:grepper = {}
let g:grepper.tools = ['rg', 'git', 'ag', 'grep']
"" gutentags
let g:gutentags_cache_dir="~/.tags" let g:gutentags_cache_dir="~/.tags"
let g:gutentags_file_list_command = { let g:gutentags_file_list_command = {
\ 'markers': { \ 'markers': {
@@ -296,8 +267,13 @@ if filereadable(expand("~/.vim/lightline.vim"))
augroup END augroup END
endif endif
"" Indent Guides "" Unimpaired
nnoremap <leader>ig :IndentGuidesToggle<CR> "" bubble single lines
nnoremap <leader>k [e
nnoremap <leader>j ]e
"" bubble multiple lines
vnoremap <leader>k [egv
vnoremap <leader>j ]egv
"" Ultisnips "" Ultisnips
let g:UltiSnipsExpandTrigger="<c-j>" let g:UltiSnipsExpandTrigger="<c-j>"
@@ -326,9 +302,9 @@ let g:jsx_ext_required = 0
" Autocmd Rules {{{ " Autocmd Rules {{{
"" do syntax highlight syncing from start
augroup general augroup general
autocmd! autocmd!
"" do syntax highlight syncing from start
autocmd BufEnter * :syntax sync fromstart autocmd BufEnter * :syntax sync fromstart
autocmd FileType netrw setl bufhidden=delete autocmd FileType netrw setl bufhidden=delete
augroup END augroup END
@@ -339,16 +315,10 @@ augroup text
autocmd FileType text,markdown,mail,tex set wrap wm=2 nocindent spell autocmd FileType text,markdown,mail,tex set wrap wm=2 nocindent spell
augroup END augroup END
"" Python
augroup python
autocmd FileType python set noexpandtab
augroup END
"" JavaScript "" JavaScript
augroup web augroup web
autocmd! autocmd!
autocmd FileType javascript map <leader>r <esc>:TernRename<CR> autocmd FileType javascript map <leader>r <esc>:TernRename<CR>
autocmd BufRead,BufNewFile *.json set ft=json
autocmd BufRead,BufNewFile *.template set filetype=html.mustache syntax=mustache autocmd BufRead,BufNewFile *.template set filetype=html.mustache syntax=mustache
augroup END augroup END

12
xinitrc
View File

@@ -11,27 +11,15 @@ if [ -d /etc/X11/xinit/xinitrc.d ]; then
unset f unset f
fi fi
pulseaudio --start
eval $(gpg-agent -s --enable-ssh-support --daemon --write-env-file $HOME/.gpg-agent-info) eval $(gpg-agent -s --enable-ssh-support --daemon --write-env-file $HOME/.gpg-agent-info)
xrdb $HOME/.Xresources xrdb $HOME/.Xresources
# add additional fonts
xset +fp /usr/share/fonts/local
xset fp rehash
echo $1 > ~/.xinitrc-arg
case $1 in case $1 in
xterm) xterm)
exec xterm exec xterm
;; ;;
herbstluftwm) # default is herbstluftwm herbstluftwm) # default is herbstluftwm
xbindkeys -n &
urxvtd &
udiskie --tray &
systemctl --user start xautolock
exec herbstluftwm --locked exec herbstluftwm --locked
;; ;;
*) *)