]> git.friedersdorff.com Git - max/saltfiles.git/commitdiff
Manage vim configuration
authorMaximilian Friedersdorff <max@friedersdorff.com>
Tue, 4 Jun 2019 11:40:47 +0000 (12:40 +0100)
committerMaximilian Friedersdorff <max@friedersdorff.com>
Tue, 4 Jun 2019 11:40:47 +0000 (12:40 +0100)
states/dotfiles.sls
states/vim/files/vimrc [new file with mode: 0644]
states/vim/gentoo.sls [new file with mode: 0644]
states/vim/init.sls [new file with mode: 0644]

index 8fdb4cc886f097b29a93aaffacfab1db74009e82..20c3fed8e5574acbe8eda0e755fd5a0afea7f010 100644 (file)
@@ -2,3 +2,4 @@ include:
   - bash
   - git
   - sway
+  - vim
diff --git a/states/vim/files/vimrc b/states/vim/files/vimrc
new file mode 100644 (file)
index 0000000..2c92bfe
--- /dev/null
@@ -0,0 +1,127 @@
+:let mapleader = "-"
+:let maplocalleader = "\\"
+
+set nocompatible              " be iMproved, required
+filetype off                  " required
+
+" set the runtime path to include Vundle and initialize
+set rtp+=~/.vim/bundle/Vundle.vim
+call vundle#begin()
+" alternatively, pass a path where Vundle should install plugins
+" call vundle#begin('~/some/path/here')
+Plugin 'gmarik/Vundle.vim'
+Plugin 'jelera/vim-javascript-syntax'
+Plugin 'noahfrederick/vim-noctu'
+Plugin 'pangloss/vim-javascript'
+Plugin 'Yggdroot/indentLine'
+Plugin 'Raimondi/delimitMate'
+Plugin 'scrooloose/syntastic'
+Plugin 'ternjs/tern_for_vim'
+Plugin 'docunext/closetag.vim'
+Plugin 'vim-airline/vim-airline'
+Plugin 'vim-airline/vim-airline-themes'
+Plugin 'airblade/vim-gitgutter'
+Plugin 'tpope/vim-fugitive'
+Plugin 'kien/ctrlp.vim'
+Plugin 'editorconfig/editorconfig-vim'
+Plugin 'LaTeX-Box-Team/LaTeX-Box'
+Plugin 'ajh17/VimCompletesMe'
+Plugin 'hynek/vim-python-pep8-indent'
+Plugin 'vim-scripts/octave.vim--'
+Plugin 'vim-scripts/MatlabFilesEdition'
+Plugin 'flazz/vim-colorschemes'
+Plugin 'benmills/vimux'
+Plugin 'tmhedberg/SimpylFold'
+Plugin 'saltstack/salt-vim'
+Plugin 'fatih/vim-go'
+Plugin 'gu-fan/riv.vim'
+Plugin 'nvie/vim-rst-tables'
+Plugin 'lepture/vim-jinja'
+
+" All of your Plugins must be added before the following line
+call vundle#end()            " required
+filetype plugin indent on    " required
+
+" Swapfiles
+set backupdir=$HOME/.vim/backup//
+
+" Random look and feel stuff
+syntax on
+set background=dark
+colorscheme molokai
+" set expandtab
+" set shiftwidth=2
+" set softtabstop=2
+set relativenumber
+
+let g:html_indent_inctags = "html,body,head,tbody"
+let g:indentLine_color_term = 200
+
+" syntastic
+set statusline+=%#warningmsg#
+set statusline+=%{SyntasticStatuslineFlag()}
+set statusline+=%*
+
+let g:syntastic_always_populate_loc_list = 1
+let g:syntastic_auto_loc_list = 2
+let g:syntastic_check_on_open = 1
+let g:syntastic_check_on_wq = 1
+let g:syntastic_javascript_checkers = ['eslint']
+let g:syntastic_python_python_exec = '/usr/bin/python3'
+let g:syntastic_python_checkers = ['flake8']
+let g:syntastic_aggregate_errors = 1
+
+" Syntastic C++11
+let g:syntastic_cpp_compiler = 'g++'
+let g:syntastic_cpp_compiler_options = '-std=c++14'
+
+set laststatus=2
+" Set this to 1 if powerline fonts are installed.
+let g:airline_powerline_fonts = 1
+set timeoutlen=1000
+let g:airline#extensions#tabline#enabled = 1
+let g:airline#extensions#tabline#fnamemod = ':t'
+
+" Setting wildignore
+set wildignore+=venv
+set wildignore+=.git,.hg.svn
+
+" CtrlP
+let g:ctrlp_working_path_mode = 'r'
+
+" Editorconfig
+let g:EditorConfig_exclude_patterns = ['fugitive://.*']
+
+" latex-box
+let g:LatexBox_quickfix = 4
+let g:LatexBox_viewer = "mupdf"
+
+" clang fix
+let g:clang_user_options='|| exit0'
+
+" Color 80th column
+highlight ColorColumn ctermbg=0
+set colorcolumn=80
+
+" Octave Syntax
+" augroup filetypedetect
+"   au! BufRead,BufNewFile *.m,*.oct set filetype=octave
+" augroup END
+
+" vimux
+map C :VimuxPromptCommand<CR>
+
+" Quiet netrw
+let g:netrw_silent = 1
+
+" Set folding
+set foldmethod=syntax
+
+" Better saving behaviour for go
+let g:go_fmt_experimental = 1
+
+" Show whitespace
+set list listchars=trail:•,extends:>,precedes:<,nbsp:␣,eol:↲,tab:→\,
+
+" Force python3 for rst tables plugin
+let g:rst_prefer_python_version = 2
diff --git a/states/vim/gentoo.sls b/states/vim/gentoo.sls
new file mode 100644 (file)
index 0000000..0941b45
--- /dev/null
@@ -0,0 +1,11 @@
+vim useflags:
+  file.managed:
+    - name: /etc/portage/package.use/vim-salt
+    - contents:
+      - app-editors/vim python
+
+install vim:
+  pkg.installed:
+    - name: app-editors/vim
+    - require:
+      - file: vim useflags
diff --git a/states/vim/init.sls b/states/vim/init.sls
new file mode 100644 (file)
index 0000000..7f1ffa5
--- /dev/null
@@ -0,0 +1,31 @@
+vimrc:
+  file.managed:
+    - name: {{ grains['homedir'] }}/.vimrc
+    - source: {{ grains['stateroot'] }}/vim/files/vimrc
+    - user: {{ grains['user'] }}
+    - group: {{ grains['user'] }}
+    - mode: 640
+
+bundle dir:
+  file.directory:
+    - name: ~/.vim/bundle
+    - user: {{ grains['user'] }}
+    - group: {{ grains['user'] }}
+    - mode: 750
+    - makedirs: True
+
+vundle:
+  git.cloned:
+    - name: https://github.com/VundleVim/Vundle.vim.git
+    - target: {{ grains['homedir'] }}/.vim/bundle/Vundle.vim
+    - user: {{ grains['user'] }}
+
+plugins install:
+  cmd.wait:
+    - name: vim +PluginInstall +qall
+    - onchanges:
+      - file: vimrc
+
+plugins update:
+  cmd.run:
+    - name: vim +PluginUpdate +qall