This commit is contained in:
Alicia Sykes 2021-01-31 20:45:12 +00:00
parent 1b08ccbcc0
commit afb55def37
28 changed files with 1003 additions and 12 deletions

View File

@ -6,18 +6,19 @@
- clean: ['~', '~/.config'] - clean: ['~', '~/.config']
- link: - link:
~/.bash:
~/.bash_profile: # vim
~/.bashrc: ~/.vim: vim
~/.dotfiles: '' ~/.vimrc: vim/vimrc
~/.gitconfig:
~/.gitignore_global: # bash
~/.gnupg/gpg.conf: ~/.bash: bash
~/.tmux.conf: ~/.bash_profile: bash/bash_profile
~/.vim: ~/.bashrc: bash/bashrc
~/.vimrc:
~/.zsh: # zsh
~/.zshrc:
# git
- shell: - shell:
- git submodule sync --recursive - git submodule sync --recursive

38
README.md Normal file
View File

@ -0,0 +1,38 @@
## Intro
My personal dot files, to configure Linux environment on desktop and server instances.
[Dotbot](https://github.com/anishathalye/dotbot) is being used to create symlinks to the right places.
Tested and used on Ubuntu, Arch Linux and Manjaro.
---
## Setup
To setup, just clone the repo, cd into it, and run the install script.
```
git clone git@github.com:Lissy93/dotfiles.git
cd dotfiles
./install.sh
```
---
## Configuring
Configuration is specified in `.install.conf.yaml` and managed with [Dotbot](https://github.com/anishathalye/dotbot).
The bootstrap configurations are idempotent (and so the installer can be run multiple times without causing any problems).
To only install certain parts of the config, pass the `--only` flag to the install.sh script, similarly `--except` can be used to exclude certain directives.
---
## Dependencies
- git
- zsh
- vim
- tmux

48
bash/bashrc Normal file
View File

@ -0,0 +1,48 @@
#!/bin/bash
## Define all the colors
COL_USER_HOST='\e[35m' # The color of 'user@host.ext'
COL_CURSOR='\e[35m' # The color of the trailing cursor arrow
COL_CURRENT_PATH='\e[37m' # The color of the current directory full path
COL_GIT_STATUS_CLEAN='\e[93m' # Color of fresh git branch name, with NO changes
COL_GIT_STATUS_CHANGES='\e[92m' # Color of git branch, affter its diverged from remote
## Text Styles
RESET='\e[0m' # What color will comand outputs be in
BOLD='\e[1m' # BOLD
## Config
SHOW_GIT=true
## If this is a valid git repo, echo the current branch name
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
## Echos what color the git branch should be (depending on changes)
check_for_git_changes() {
if [[ "$(parse_git_branch)" ]]; then
if [[ $(git status --porcelain) ]]; then
echo ${COL_GIT_STATUS_CLEAN}
else
echo ${COL_GIT_STATUS_CHANGES}
fi
fi
}
## Build-up what will be the final PS1 string
set_bash_prompt(){
PS1="${RESET}"
PS1+="${BOLD}${COL_USER_HOST}\u @ \h ${RESET}${COL_CURRENT_PATH}\w "
if [ "$SHOW_GIT" = true ] ; then
PS1+="$(check_for_git_changes)"
PS1+="$(parse_git_branch)"
fi
PS1+="\n${COL_CURSOR}└─▶ "
PS1+="${RESET}"
}
## Done, now just set the PS1 prompt :)
PROMPT_COMMAND=set_bash_prompt

View File

@ -1,5 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
echo "Starting the Dot File Install Script..."
set -e set -e
CONFIG=".install.conf.yaml" CONFIG=".install.conf.yaml"

View File

@ -0,0 +1,14 @@
setlocal foldmethod=syntax
setlocal nospell
let b:ale_linters = ['elm_ls']
let b:ale_fixers = ['trim_whitespace', 'remove_trailing_lines', 'elm-format']
let b:ale_linters_ignore = { 'elm': ['make'] }
" autocompleting ought to be provided via elm-language-server
" also when coding elm there's an error from deoplete telling
" that elm-oracle is not available
" but then again elm-oracle does not work with 0.19
" issue <| https://github.com/pbogut/deoplete-elm/issues/3
let b:deoplete_disable_auto_complete = 1
let b:ale_completion_enabled = 1

View File

@ -0,0 +1 @@
let b:ale_fixers = ['trim_whitespace', 'remove_trailing_lines']

View File

@ -0,0 +1 @@
let b:ale_fixers = ['trim_whitespace', 'remove_trailing_lines', 'prettier']

View File

@ -0,0 +1,6 @@
fu! s:InstallRequirements()
silent !clear
execute '!' . 'pip install -r ' . bufname('%')
endfu
:command! -bar InstallRequirements :call s:InstallRequirements()

View File

@ -0,0 +1,2 @@
let b:ale_fixers = ['trim_whitespace', 'shfmt']
let b:ale_linters = ['shellcheck', 'language_server']

View File

@ -0,0 +1,4 @@
setlocal nospell
setlocal encoding=utf-8
setlocal tabstop=2
setlocal shiftwidth=2

View File

@ -0,0 +1 @@
let b:ale_fixers = ['trim_whitespace', 'remove_trailing_lines', 'prettier']

0
vim/autoload/.gitkeep Normal file
View File

204
vim/editor.vim Normal file
View File

@ -0,0 +1,204 @@
scriptencoding utf-8
" Copyright 2018-2020 @ kornicameister
" save from typing :
nnoremap ; :
" general settings for editor
syntax on
set smartindent
set noerrorbells
set novisualbell
set timeoutlen=500
" searching stuff
nnoremap n nzzzv " center line on next search
nnoremap N Nzzzv " -----------//------------
" no temp or backup files
set noswapfile
set nobackup
set nowritebackup
set nowrap " do not wrap lines
" tabs settings
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
set smarttab
" indentation settings
set autoindent
set copyindent
" disable modelines
set modelines=0
set nomodeline
" set title
set title
" make searching smart
if executable('ag')
set grepprg=ag\ --nogroup\ --nocolor\ --vimgrep
set grepformat^=%f:%l:%c:%m
endif
set ignorecase
set smartcase
" Make the keyboard fast
set ttyfast
set timeout timeoutlen=1000 ttimeoutlen=50
" backspace fix
set backspace=indent,eol,start
" wrap movement
set whichwrap+=<,>,h,l,[,]
" Show linenumbers
set number relativenumber
augroup numbertoggle
autocmd!
autocmd BufEnter,FocusGained,InsertLeave * set relativenumber
autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber
augroup END
set ruler
" make whitespaces, tabs visible
set list
set listchars-=nbsp:+
set listchars-=trail-
set listchars+=trail:•,nbsp:~,eol:↵
highlight BadWhitespace ctermbg=red guibg=red
" always display status line
set laststatus=2
set cmdheight=1
" enable filetypes plugins
filetype plugin indent on
" spelling
setlocal nospell
map <silent> <leader>ss :setlocal spell!<cr>
hi SpellBad cterm=underline,bold ctermfg=red
" tabs keybindings
map <C-t><up> :tabr<cr>
map <C-t><down> :tabl<cr>
map <C-left> :tabp<cr>
map <C-right> :tabn<cr>
" splitting windows settings
set splitbelow
set splitright
" quicker navigation
nnoremap <silent> <C-J> <C-W><C-J>
nnoremap <silent> <C-K> <C-W><C-K>
nnoremap <silent> <C-L> <C-W><C-L>
nnoremap <silent> <C-H> <C-W><C-H>
" quicker resizing with arrows
nnoremap <silent> <C-Left> :vertical resize +2<CR>
nnoremap <silent> <C-Right> :vertical resize -2<CR>
nnoremap <silent> <C-Up> :resize +2<CR>
nnoremap <silent> <C-Down> :resize -2<CR>
" Enable folding
set foldmethod=indent
set foldlevel=99
nnoremap <Space> za
vnoremap <Space> za
" quickly edit/reload vimrc
nmap <silent> <leader>ev :e $MYVIMRC<CR>
nmap <silent> <leader>sv :so $MYVIMRC<CR>
" do not close the buffer, hide them to preserve
" markers, undo etc
set hidden
set history=1000 " increase history size
set undolevels=1000 " ----------//---------
" in case we forgot sudo
cmap w!! w !sudo tee % >/dev/null
" normal OS clipboard interaction
set clipboard+=unnamedplus
" wilderness
set wildignore+=*.BACKUP.*,*.BASE.*,*.LOCAL.*,*.REMOTE.*
set wildignore+=/tmp/**
set wildignore=*.o,*.obj,*~,*.exe,*.a,*.pdb,*.lib
set wildignore+=*.so,*.dll,*.swp,*.egg,*.jar,*.class,*.pyc,*.pyo,*.bin,*.dex
set wildignore+=*.log,*.pyc,*.sqlite,*.sqlite3,*.min.js,*.min.css,*.tags
set wildignore+=*.zip,*.7z,*.rar,*.gz,*.tar,*.gzip,*.bz2,*.tgz,*.xz
set wildignore+=*.png,*.jpg,*.gif,*.bmp,*.tga,*.pcx,*.ppm,*.img,*.iso
set wildignore+=*.pdf,*.dmg,*.app,*.ipa,*.apk,*.mobi,*.epub
set wildignore+=*.mp4,*.avi,*.flv,*.mov,*.mkv,*.swf,*.swc
set wildignore+=*.ppt,*.pptx,*.doc,*.docx,*.xlt,*.xls,*.xlsx,*.odt,*.wps
set wildignore+=*/.git/*,*/.svn/*,*.DS_Store
set wildignore+=*/node_modules/*,*/nginx_runtime/*,*/build/*,*/logs/*,*/dist/*,*/tmp/*
set wildignore+=*/elm-stuff/*
set wildignore+=*/.aws-sam/*
set wildmode=longest:full,full
set wildmenu
" netrw (file browser)
let g:netrw_banner=0 " disable annoying banner
let g:netrw_browse_split=4 " open in prior window
let g:netrw_altv=1 " open splits to the right
let g:netrw_liststyle=3 " tree view
let g:netrw_list_hide=netrw_gitignore#Hide()
let g:netrw_list_hide.=',\(^\|\s\s\)\zs\.\S\+'
" navigate through the buffers
nnoremap <silent> <Tab> :bnext<CR>
nnoremap <silent> <S-Tab> :bprevious<CR>
nnoremap <silent> <leader>q :bd<cr>gT
nnoremap <silent> <leader>Q :bufdo bd<CR>
nnoremap <silent> <leader>r :e<CR>
nnoremap <silent> <leader>R :e!<CR>
augroup save_on_focus_out
autocmd!
au FocusLost * :wa
set autoread
augroup END
augroup help_vertical
au!
command! -nargs=* -complete=help Help vertical belowright help <args>
autocmd FileType help wincmd L
augroup END
augroup colorscheme_customization
au!
if has('termguicolors')
set termguicolors
endif
if has_key(g:plugs, 'dracula')
let g:dracula_bold = 1
let g:dracula_italic = 1
let g:dracula_colorterm = 0
set background=dark
colorscheme dracula
if has_key(g:plugs, 'vim-airline')
let g:airline_theme = 'dracula'
call airline#load_theme() | call airline#update_statusline()
endif
endif
augroup END

51
vim/filetype.vim Normal file
View File

@ -0,0 +1,51 @@
scriptencoding utf-8
set fileformats=unix,dos,mac
augroup git_ft_config
au!
au BufNewFile,BufRead gitconfig setlocal ft=gitconfig nolist nospell ts=4 sw=4 noet
au BufNewFile,BufRead .gitconfig* setlocal ft=gitconfig nolist nospell ts=4 sw=4 noet
au FileType gitcommit setlocal nospell
augroup END
augroup js_ft_settings
au!
au BufRead,BufNewFile *.js,*.jsx set et ai ts=4 sts=4 sw=4 tw=79
au BufRead,BufNewFile *.js,*.jsx match BadWhitespace /^\t\+/
au BufRead,BufNewFile *.js,*.jsx match BadWhitespace /\s\+$/
au BufNewFile *.js,*.jsx set fileformat=unix
au BufRead,BufNewFile *.js,*.jsx let b:comment_leader = '//'
augroup END
augroup sh_ft_settings
au!
au BufNewFile,BufRead *.sh setlocal ai et ts=2 sw=2 sts=2
augroup END
augroup vim_ft_settings
au!
au BufNewFile,BufRead *.vim setlocal ai et ts=2 sw=2 sts=2
augroup END
augroup text_ft_settings
au!
au BufNewFile,BufRead *.txt setlocal et ts=4 sw=4
augroup END
augroup cpp_ft_settings
au!
au BufNewFile,BufRead *.cpp setlocal et ts=2 sw=2
au BufNewFile,BufRead *.hpp setlocal et ts=2 sw=2
augroup END
augroup json_ft_settings
au!
au FileType json setlocal foldmethod=syntax
au BufNewFile,BufRead *.json setlocal et ts=2 sw=2
augroup END
augroup asciidoc_ft_settings
au!
au FileType asciidoc setlocal spell
augroup END

View File

@ -0,0 +1,4 @@
augroup cfn
au BufRead,BufNewFile template.yml set filetype=yaml.cloudformation
au BufRead,BufNewFile *.template.yml set filetype=yaml.cloudformation
augroup END

View File

@ -0,0 +1,4 @@
augroup sshconfig_ft
au BufNewFile,BufRead *ssh/config setfiletype sshconfig
au BufNewFile,BufRead *ssh/config.d/*.config setfiletype sshconfig
augroup END

View File

@ -0,0 +1,7 @@
if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1
set spell
set spelllang=en

19
vim/ftplugin/go.vim Normal file
View File

@ -0,0 +1,19 @@
if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1
let b:ale_linters = ['go build', 'gometalinter', 'gopls']
let b:ale_fixers = ['gofmt', 'goimports', 'trim_whitespace']
setlocal noexpandtab
setlocal shiftwidth=4
setlocal softtabstop=4
setlocal tabstop=4
setlocal nolisp
setlocal autoindent
setlocal nospell
set makeprg=go " point :make to go binary

18
vim/ftplugin/markdown.vim Normal file
View File

@ -0,0 +1,18 @@
if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1
setlocal spell
setlocal expandtab
setlocal tabstop=4
setlocal shiftwidth=4
setlocal textwidth=99
" spellcheck
setlocal spell
" generate TOC quicker
nmap <buffer> <silent> <Leader>toc :GenTocGFM<CR>
let b:ale_fixers = ['trim_whitespace', 'remove_trailing_lines', 'prettier']

67
vim/ftplugin/python.vim Normal file
View File

@ -0,0 +1,67 @@
if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1
setlocal expandtab
setlocal autoindent
setlocal smartindent
setlocal textwidth=79
setlocal tabstop=4
setlocal softtabstop=4
setlocal shiftwidth=4
setlocal fileformat=unix
set backspace=indent,eol,start
match BadWhitespace /^\t\+/
match BadWhitespace /\s\+$/
let b:comment_leader = '#'
let b:ale_fix_on_save = 0
let b:ale_linters = ['mypy', 'flake8']
let b:ale_fixers = ['trim_whitespace', 'remove_trailing_lines']
if isdirectory($VIRTUAL_ENV)
let s:yapf_bin = expand($VIRTUAL_ENV.'/bin/yapf')
let s:black_bin = expand($VIRTUAL_ENV.'/bin/black')
if executable(s:black_bin)
call add(b:ale_fixers, 'black')
elseif executable(s:yapf_bin)
call add(b:ale_fixers, 'yapf')
endif
elseif executable('yapf')
call add(b:ale_fixers, 'yapf')
elseif executable('black')
call add(b:ale_fixers, 'black')
endif
" if enabled, it makes flake8 loose its configuration file in project root
let b:ale_python_flake8_change_directory = 0
" always load pyls from neovim3 virtualenv :)
let b:ale_python_pyls_executable = expand(fnamemodify(g:python3_host_prog, ':h') . '/' . 'pyls')
if executable(b:ale_python_pyls_executable)
call add(b:ale_linters, 'pyls')
let b:ale_python_pyls_config = {
\ 'pyls': {
\ 'plugins': {
\ 'flake8': {'enabled': v:true},
\ 'mypy': {'enabled': v:true},
\ 'yapf': {'enabled': v:true},
\ 'pyflakes': {'enabled': v:false},
\ 'pycodestyle': {'enabled': v:false},
\ 'jedi': {'enabled': v:true},
\ 'rope': {'enabled': v:true},
\ 'jedi_definition': {
\ 'follow_imports': v:true,
\ 'follow_builtin_imports': v:true,
\ },
\ }
\ }}
endif

13
vim/ftplugin/scss.vim Normal file
View File

@ -0,0 +1,13 @@
if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1
setlocal autoindent
setlocal expandtab
setlocal tabstop=2
setlocal shiftwidth=2
setlocal softtabstop=2
" ale fixer settings
let b:ale_fixers = ['trim_whitespace', 'remove_trailing_lines', 'prettier']

11
vim/ftplugin/vue.vim Normal file
View File

@ -0,0 +1,11 @@
if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1
setlocal tabstop=2
setlocal softtabstop=2
setlocal shiftwidth=2
let b:ale_fix_on_save = 1
let b:ale_fixers = ['prettier', 'trim_whitespace', 'remove_trailing_lines']

38
vim/ftplugin/yaml.vim Normal file
View File

@ -0,0 +1,38 @@
if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1
setlocal expandtab
setlocal tabstop=2
setlocal softtabstop=2
setlocal shiftwidth=2
setlocal foldmethod=indent
setlocal nowrap
setlocal indentexpr=GetYamlIndent()
setlocal indentkeys=o,O,*<Return>,!^F
function! GetYamlIndent()
let prevlnum = v:lnum - 1
if prevlnum == 0
return 0
endif
let line = substitute(getline(v:lnum),'\s\+$','','')
let prevline = substitute(getline(prevlnum),'\s\+$','','')
let indent = indent(prevlnum)
let increase = indent + &shiftwidth
let decrease = indent - &shiftwidth
if prevline =~# ':$'
return increase
elseif prevline =~# '^\s\+\-' && line =~# '^\s\+[^-]\+:'
return decrease
else
return indent
endif
endfunction
let b:ale_linters = ['yamllint', 'cloudformation']
let b:ale_fixers = ['trim_whitespace', 'remove_trailing_lines', 'prettier']

384
vim/plugins.vim Normal file
View File

@ -0,0 +1,384 @@
scriptencoding utf-8
" Copyright 2018-2020 @ kornicameister
" define the plugins
call plug#begin('~/.vim/plugged')
" vim compatibility
if !has('nvim')
Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc'
endif
" theme
Plug 'dracula/vim', { 'as': 'dracula' }
" fzf
Plug '~/.fzf'
Plug 'junegunn/fzf.vim'
" git plugins
Plug 'tpope/vim-fugitive'
Plug 'airblade/vim-gitgutter'
Plug 'octref/rootignore'
Plug 'rhysd/committia.vim'
Plug 'tpope/vim-git'
" ale plugin
Plug 'vim-scripts/dbext.vim', { 'for': ['sql'] }
Plug 'dense-analysis/ale'
Plug 'da-x/depree', { 'do': './rebuild.sh' }
" deoplete
if has('nvim')
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
else
Plug 'Shougo/deoplete.nvim', { 'do': '!pip install --user --upgrade neovim' }
endif
Plug 'Shougo/neoinclude.vim'
Plug 'Shougo/neco-vim', { 'for': ['vim', 'viminfo'] }
Plug 'deoplete-plugins/deoplete-jedi', { 'for': ['python'] }
Plug 'deoplete-plugins/deoplete-tag'
Plug 'deoplete-plugins/deoplete-docker'
Plug 'deoplete-plugins/deoplete-zsh', { 'for': ['zsh'] }
" asynchronous execution library
Plug 'Shougo/vimproc.vim', { 'do' : 'make' }
" general editor related plugins
Plug 'luochen1990/rainbow'
Plug 'ConradIrwin/vim-bracketed-paste'
Plug 'vim-airline/vim-airline'
Plug 'tpope/vim-surround'
Plug 'scrooloose/nerdcommenter'
Plug 'psliwka/vim-smoothie'
" javascript & typescript plugins
Plug 'pangloss/vim-javascript', { 'for': ['javascript'] }
Plug 'mxw/vim-jsx', { 'for' : ['jsx'] }
Plug 'HerringtonDarkholme/yats.vim', { 'for': ['typescript'] }
" docker
Plug 'ekalinin/Dockerfile.vim', { 'for': ['dockerfile', 'docker-compose', 'Dockerfile'], 'do': 'make install' }
" elm
" per recommendation at: https://github.com/elm-tooling/elm-vim/blob/master/README.md
Plug 'andys8/vim-elm-syntax', {'for': ['elm']}
" python
Plug 'tmhedberg/SimpylFold', {'for': ['python']}
Plug 'lambdalisue/vim-pyenv', {'for': ['python']}
Plug 'vim-scripts/indentpython.vim', {'for': ['python']}
Plug 'raimon49/requirements.txt.vim', {'for': ['requirements']}
if has('nvim')
Plug 'kalekseev/vim-coverage.py', { 'do': ':UpdateRemotePlugins', 'for': ['python'] }
Plug 'numirias/semshi', { 'do': ':UpdateRemotePlugins' }
else
Plug 'kalekseev/vim-coverage.py', { 'do': '!pip install --user --upgrade neovim', 'for': ['python']}
endif
" go
Plug 'arp242/gopher.vim', { 'for': ['go'] }
Plug 'deoplete-plugins/deoplete-go', { 'for': ['go'], 'do': 'make' }
" json
Plug 'elzr/vim-json', {'for': ['json']}
" markdown
Plug 'gabrielelana/vim-markdown', {'for': ['markdown']}
Plug 'mzlogin/vim-markdown-toc', {'for': ['markdown']}
" tex
Plug 'lervag/vimtex', { 'for': ['tex'] }
" various
Plug 'wakatime/vim-wakatime' " track what I am doing when using vim
Plug 'ryanoasis/vim-devicons' " cool icons
Plug 'haya14busa/incsearch.vim' " incremental searching
Plug 'ap/vim-css-color' " colors for colors
Plug 'farmergreg/vim-lastplace' " open editor where it was
Plug 'zinit-zsh/zinit-vim-syntax' " zinit power
Plug 'mustache/vim-mustache-handlebars'
Plug 'triglav/vim-visual-increment'
" nginx
Plug 'chr4/nginx.vim'
" tags
Plug 'majutsushi/tagbar' " visiting tags as pro
Plug 'ludovicchabant/vim-gutentags'
" testing made fun
Plug 'janko/vim-test'
call plug#end()
" Plugin Customizations
" =====================
augroup vim_test_settings
autocmd!
let g:test#strategy = 'neovim'
let g:test#neovim#term_position = 'vertical'
" integrate with coverage tool
let g:test#python#pytest#options = '--cov-branch --cov-context=test'
" disable vim-projectionist
let g:test#no_alternate = 1
nmap <silent> <C-t>n :TestNearest<CR>
nmap <silent> <C-t>f :TestFile<CR>
nmap <silent> <C-t>s :TestSuite<CR>
nmap <silent> <C-t>l :TestLast<CR>
nmap <silent> <C-t>v :TestVisit<CR>
augroup end
augroup tagbar_plugin_settins
autocmd!
let g:tagbar_ctags_bin='ctags'
let g:tagbar_iconchars = ['►', '▼']
let g:tagbar_autoclose = 1
let g:tagbar_type_markdown = {
\ 'ctagstype' : 'markdown',
\ 'kinds' : [
\ 'h:headings',
\ 'l:links',
\ 'i:images'
\ ],
\ }
let g:tagbar_type_sh = {
\ 'ctagstype' : 'sh',
\ 'kinds' : [
\ 'f:functions',
\ 'v:variables',
\ ],
\ }
let g:tagbar_type_elm = {
\ 'ctagstype' : 'elm',
\ 'kinds' : [
\ 'm:module',
\ 'i:imports',
\ 't:types',
\ 'C:constructors',
\ 'c:constants',
\ 'f:functions',
\ 'p:ports'
\ ],
\ }
let g:tagbar_type_ansible = {
\ 'ctagstype' : 'ansible',
\ 'kinds' : [
\ 't:tasks'
\ ],
\ }
nmap <F8> :TagbarToggle<CR>
augroup END
" always color brackets
let g:rainbow_active = 1
if has_key(g:plugs, 'vim-airline')
augroup airline_plugin_settings
autocmd!
let g:airline_powerline_fonts = 1
let g:airline_left_sep='' " Slightly fancier than '>'
let g:airline_right_sep='' " Slightly fancier than '<'
let g:airline#extensions#ale#enabled = 1
let g:airline#extensions#tabline#formatter = 'unique_tail_improved'
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#left_sep=' '
let g:airline#extensions#tabline#left_alt_sep=' '
let g:airline#extensions#tabline#buffer_nr_format = '%s '
let g:airline#extensions#tabline#buffer_nr_show = 1
augroup END
endif
augroup elm_plugin_settings
autocmd!
let g:elm_setup_keybindings = 0
let g:elm_format_autosave = 0
augroup END
" commit msg - very nerdy
let g:committia_hooks = {}
function! g:committia_hooks.edit_open(info)
" Scroll the diff window from insert mode
" Map <C-n> and <C-p>
imap <buffer><C-n> <Plug>(committia-scroll-diff-down-half)
imap <buffer><C-p> <Plug>(committia-scroll-diff-up-half)
endfunction
" python
let python_highlight_all = 1
let g:pyenv#auto_create_ctags = 1
let g:pyenv#auto_assign_ctags = 1
" gutter
augroup gitgutter_options
autocmd!
let g:gitgutter_diff_args = '-w' " ignore whitespace changes
let g:gitgutter_sign_added = ''
let g:gitgutter_sign_modified = ''
let g:gitgutter_sign_modified_removed = ''
let g:gitgutter_sign_removed = ''
let g:gitgutter_sign_removed_first_line = ''
let g:gitgutter_highlight_linenrs = 1
nmap <A-,> <Plug>(GitGutterUndoHunk)
nmap <A-.> <Plug>(GitGutterStageHunk)
nmap <A-/> <Plug>(GitGutterPreviewHunk)
augroup END
augroup incremental_search_options
autocmd!
map / <Plug>(incsearch-forward)
map ? <Plug>(incsearch-backward)
map g/ <Plug>(incsearch-stay)
" automatically turn off hlsearch
set hlsearch
let g:incsearch#auto_nohlsearch = 1
" and deal in some mappings
map n <Plug>(incsearch-nohl-n)
map N <Plug>(incsearch-nohl-N)
map * <Plug>(incsearch-nohl-*)
map # <Plug>(incsearch-nohl-#)
map g* <Plug>(incsearch-nohl-g*)
map g# <Plug>(incsearch-nohl-g#)
" do not persist search end
let g:incsearch#do_not_save_error_message_history = 1
" different highlight colors
let g:incsearch#separate_highlight = 1
augroup END
augroup gutentags_options
autocmd!
let g:gutentags_ctags_tagfile = '.git/tags'
let g:gutentags_file_list_command = {
\ 'markers': {
\ '.git': 'git grep --cached -I -l -e $""',
\ },
\ }
augroup END
augroup vim_go_options
autocmd!
let g:gopher_highlight = ['string-spell', 'string-fmt']
let g:gometalinter_fast = ''
\ . ' --enable=vet'
\ . ' --enable=errcheck'
\ . ' --enable=ineffassign'
\ . ' --enable=goimports'
\ . ' --enable=misspell'
\ . ' --enable=lll --line-length=120'
let g:ale_go_gometalinter_options = '--disable-all --tests' . g:gometalinter_fast . ' --enable=golint'
augroup END
" deoplete settings
if has_key(g:plugs, 'deoplete.nvim')
augroup deoplete_options
autocmd!
let g:deoplete#enable_at_startup = 1
let g:deoplete#enable_fefresh_always = 1
call deoplete#custom#var('omni', 'input_patterns', {})
call deoplete#custom#option({
\ 'auto_complete_delay': 50,
\ 'smart_case': v:true,
\ 'max_list': 50,
\ })
let g:deoplete#sources#go#gocode_binary = $GOPATH.'/bin/gocode'
let g:deoplete#sources#go#source_importer = 0 " that one is deprecated
let g:deoplete#sources#go#builtin_objects = 1 " might be useful
let g:deoplete#sources#go#sort_class = [
\ 'package',
\ 'func',
\ 'type',
\ 'var',
\ 'const'
\] " sorting matters
let g:deoplete#sources#go#pointer = 1 " Enable completing of go pointers
let g:deoplete#sources#go#unimported_packages = 1 " autocomplete unimported packages
augroup END
endif
if has_key(g:plugs, 'fzf.vim')
augroup fzf_settings
autocmd!
" fzf mappings
nmap <Leader>t :Tags<CR>
nmap <Leader>bt :BTags<CR>
nmap <Leader>f :GFiles<CR>
nmap <Leader>F :Files<CR>
nmap <Leader>c :Commits<CR>
nmap <Leader>b :Buffers<CR>
nmap <leader><tab> <plug>(fzf-maps-n)
xmap <leader><tab> <plug>(fzf-maps-x)
omap <leader><tab> <plug>(fzf-maps-o)
" floating window
let g:fzf_layout = { 'window': { 'width': 0.9, 'height': 0.6 } }
augroup END
" ale settings
augroup ale_plugin_settings
autocmd!
let g:ale_fix_on_save = 1 " run on save
let g:ale_lint_on_save = 1 " 2 options allow to lint only when file is saved
let g:ale_lint_on_text_changed = 'never'
let g:ale_lint_on_enter = 1 " lint when entering the buffer
let g:ale_completion_enabled = 0 " do not mix up stuff with deoplete
let g:ale_sign_error = '✖' " error sign
let g:ale_sign_warning = '⚠' " warning sign
let g:ale_fixers = ['trim_whitespace', 'remove_trailing_lines']
let g:ale_echo_msg_error_str = 'E'
let g:ale_echo_msg_warning_str = 'W'
let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
let g:ale_set_balloons = 1
nmap <A-f> <Plug>(ale_fix)<CR>
nmap <A-l> <Plug>(ale_lint)<CR>
nmap <A-d> <Plug>(ale_detail)<CR>
nmap <A-k> <Plug>(ale_previous_wrap)
nmap <A-j> <Plug>(ale_next_wrap)
nmap <F3> <Plug>(ale_hover)
nmap <F4> <Plug>(ale_go_to_definition)
if has('nvim')
autocmd VimEnter *
\ set updatetime=1000 |
\ let g:ale_lint_on_text_changed = 0
autocmd CursorHold * call ale#Queue(0)
autocmd CursorHoldI * call ale#Queue(0)
autocmd InsertEnter * call ale#Queue(0)
autocmd InsertLeave * call ale#Queue(0)
else
echoerr 'only neovim can handle kornicameister dotfiles'
endif
augroup END
endif

15
vim/session.vim Normal file
View File

@ -0,0 +1,15 @@
scriptencoding utf-8
" Copyright 2018-2020 @ kornicameister
" Contains useful stuff for handling the sessions in Vim
" persistent undo, for making more 'u' operations
if has('persistent_undo')
set undodir=~/.vim/undodir
set undofile
set undolevels=1000
set undoreload=10000
endif
" Remember info about open buffers on close
set viminfo^=%

11
vim/spell/en.utf-8.add Normal file
View File

@ -0,0 +1,11 @@
workshift
whitelist
keypair
keypairs
Tomasz
Trębski
kornicameister
github
dracula
UI
json

12
vim/spell/pl.utf-8.add Normal file
View File

@ -0,0 +1,12 @@
Inicjalizacja
Inicjalizacja
JSON
inicjalizację
inkrementalnie
korutyny
korytuna
walidowania
HTTPs
SSH
Github
PPA

15
vim/vimrc Normal file
View File

@ -0,0 +1,15 @@
set fileencoding=utf-8 " utf-8 forever
set fileencodings=utf-8
set fileformats=unix " only UNIX
set shell=/bin/zsh " ZSH
let mapleader = ',' " early leader swap
let g:mapleader = ','
let b:mapleader = ','
source ~/.vim/plugins.vim
source ~/.vim/editor.vim
source ~/.vim/filetype.vim
source ~/.vim/session.vim