VIM: Cleanup

- .vimrc:
        Restructured the settings.
        Moved the Rmarkdown settings to a new config file
        'config/filetypes.vim'

- config/plugin.vim:
        Fixed spacing

- .gitmodules: moved traces.vim down

Signed-off-by: Tobias Manske <tobias.manske@mailbox.org>
This commit is contained in:
Tobias Manske 2018-09-01 11:17:30 +02:00
parent b98cc52343
commit 5cbb3a63c6
No known key found for this signature in database
GPG Key ID: 978D99F12D4E041F
4 changed files with 50 additions and 53 deletions

6
.gitmodules vendored
View File

@ -148,12 +148,12 @@
[submodule "vim/plugins/ansible-vim"]
path = vim/plugins/ansible-vim
url = https://github.com/pearofducks/ansible-vim
[submodule "vim/plugins/traces.vim"]
path = vim/plugins/traces.vim
url = https://github.com/markonm/traces.vim
[submodule "vim/plugins/vim-window-resize-easy"]
path = vim/plugins/vim-window-resize-easy
url = https://github.com/roxma/vim-window-resize-easy
[submodule "vim/plugins/traces.vim"]
path = vim/plugins/traces.vim
url = https://github.com/markonm/traces.vim
[submodule "vim/plugins/nerdtree"]
path = vim/plugins/nerdtree
url = https://github.com/scrooloose/nerdtree

View File

@ -1,68 +1,54 @@
set encoding=utf-8
" Plugin Manager
execute pathogen#infect('plugins/{}')
execute pathogen#infect('snippets/{}')
autocmd vimenter * Helptags
" Prepare central backup/swap/undo directory
let &undodir = expand('~/.vim/.undo')
let &backupdir = expand('~/.vim/.backup//')
let &directory = expand('~/.vim/.swp//')
syntax on
filetype plugin on
filetype plugin indent on
set number
set relativenumber
set autochdir
set encoding=utf-8
" Use whitespace instead of tab
set expandtab
let &undodir = expand('~/.vim/.undo')
let &backupdir = expand('~/.vim/.backup//')
let &directory = expand('~/.vim/.swp//')
set undofile
colorscheme happy_hacking
source ~/.vim/config/plugin.vim
source ~/.vim/config/keybindings.vim
" General editor settings
" Make a tabulator equal 4 spaces
set tabstop=4
set shiftwidth=4
" Enable persistent undo
set undofile
" Use relative line numbers
set number
set relativenumber
" Set linelength indicator to 120 characters
set cc=120
" Natural window splitting
set splitbelow
set splitright
let g:netrw_liststyle = 3
let g:netrw_browse_split = 4
let g:netrw_winsize = 20
let g:netrw_altv = 0
let g:netrw_banner = 0
let g:tex_conceal = ""
function! ForceResizeNetrw()
let curWin = winnr()
for winnr in range(1, winnr('$'))
if getwinvar(winnr, '&ft')=="netrw"
if curWin != winnr
silent noautocmd exec winnr 'wincmd w'
silent noautocmd exec 'vertical resize ' . g:netrw_winsize
silent noautocmd exec curWin 'wincmd w'
else
silent noautocmd exec 'vertical resize ' . g:netrw_winsize
endif
endif
endfor
endfunction
" Set colors
colorscheme happy_hacking
autocmd WinEnter * call ForceResizeNetrw()
autocmd BufNew * call ForceResizeNetrw()
" Apply plugin configurations
source ~/.vim/config/plugin.vim
" R Markdown
function Rmarkdown()
set filetype=markdown
set conceallevel=0
let g:markdown_syntax_conceal=0
let g:markdown_fenced_languages=['r', 'python', 'html', 'sql', 'bash=sh']
endfunction
autocmd BufNewFile,BufReadPost *.Rmd call Rmarkdown()
autocmd BufNewFile,BufReadPost *.rmd call Rmarkdown()
" Apply custom keybindings
source ~/.vim/config/keybindings.vim
" Apply settings for custom filetypes
source ~/.vim/config/filetypes.vim
" Rebuild help files on startup
autocmd vimenter * Helptags
" Transparency
hi Normal guibg=NONE ctermbg=NONE

13
vim/config/filetypes.vim Normal file
View File

@ -0,0 +1,13 @@
" This config includes custom settings for special filetypes
" Rmarkdown / .rmd
function Rmarkdown()
set filetype=markdown
set conceallevel=0
let g:markdown_syntax_conceal=0
let g:markdown_fenced_languages=['r', 'python', 'html', 'sql', 'bash=sh']
endfunction
autocmd BufNewFile,BufReadPost *.Rmd call Rmarkdown()
autocmd BufNewFile,BufReadPost *.rmd call Rmarkdown()

View File

@ -21,8 +21,6 @@ let g:airline_theme="minimalist"
autocmd TextChanged * GitGutter
" JavaComplete
if has("autocmd")
autocmd Filetype java setlocal omnifunc=javacomplete#CompleteParamsInfo