plugins: Fix indentation
[vimconf.git] / init.vim
index eb6662d6c35ac25941e0df19c7b3c445db3fba3d..845bc422d3321a9bdc81f5c63d0b7fcc013bf118 100644 (file)
--- a/init.vim
+++ b/init.vim
@@ -6,9 +6,6 @@
 " Some global settings
 
 set nocompatible
-" Breaks colors for some versions of mosh, but not if tmux is used on top of
-" mosh. See https://github.com/mobile-shell/mosh/issues/928
-set termguicolors
 set number
 set cursorline
 set scrolloff=5
@@ -47,6 +44,12 @@ syntax on
 " Load some macros
 runtime macros.vim
 
+if filereadable($HOME . '/.vim/lowendbox')
+    let g:lowendbox = 1
+else
+    let g:lowendbox = 0
+endif
+
 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 " Some global plugin settings
 
@@ -94,8 +97,17 @@ let g:airline#extensions#branch#enabled=1
 
 let g:gruvbox_contrast_light='hard'
 let g:gruvbox_contrast_dark='hard'
-let g:gruvbox_italic = 1
 set bg=dark
+
+if &term =~ 'linux'
+    let g:gruvbox_termcolors=16
+else
+    " Setting termguicolors has two implications:
+    " - Breaks colors for some versions of mosh, but not if tmux is used on top of
+    "   mosh. See https://github.com/mobile-shell/mosh/issues/928
+    set termguicolors
+    let g:gruvbox_italic = 1
+endif
 colorscheme gruvbox
 
 " let NERDTreeWinPos="right"
@@ -104,28 +116,29 @@ let NERDTreeWinSize=22
 let NERDTreeQuitOnOpen=1
 "au VimEnter * if !argc() | Startify | NERDTree | wincmd w
 
-let g:neomake_c_enabled_makers = ['clangtidy', 'clangcheck']
-let g:neomake_cpp_enabled_makers = ['clangtidy', 'clangcheck']
-
-" Taken from neomake
-if OnBattery()
-  call neomake#configure#automake('w')
-else
-  call neomake#configure#automake('nw', 1000)
+if $USER != "root" && g:lowendbox == 0
+    let g:neomake_c_enabled_makers = ['clangtidy', 'clangcheck']
+    let g:neomake_cpp_enabled_makers = ['clangtidy', 'clangcheck']
+    let g:clang_compilation_database = '.'
+
+    " Taken from neomake
+    if OnBattery()
+        call neomake#configure#automake('w')
+    else
+        call neomake#configure#automake('nw', 1000)
+    endif
+
+    " Speedup deoplete startup time, see deoplete FAQ
+    let g:python3_host_prog = '/usr/bin/python3'
+    " deoplete requires huge startuptime. Delay loading upon first InsertEnter.
+    let g:deoplete#enable_at_startup = 0
+    call deoplete#custom#option({
+                \ 'smart_case' : v:true,
+                \ 'auto_refresh_delay' : 100,
+                \ })
+    au InsertEnter * call deoplete#enable()
 endif
 
-let g:clang_compilation_database = '.'
-
-" Speedup deoplete startup time, see deoplete FAQ
-let g:python3_host_prog = '/usr/bin/python3'
-" deoplete requires huge startuptime. Delay loading upon first InsertEnter.
-let g:deoplete#enable_at_startup = 0
-call deoplete#custom#option({
-                            \ 'smart_case' : v:true,
-                            \ 'auto_refresh_delay' : 100,
-                            \ })
-au InsertEnter * call deoplete#enable()
-
 "augroup pencil
   "au!
   "au FileType markdown,mkd call pencil#init()
@@ -171,6 +184,8 @@ au BufEnter *.cpp,*.cc,*.cxx let b:fswitchdst='h,hxx,hpp,hh'
 au BufEnter *.h,*.hh,*.hxx let b:fswitchdst='cc,c,cxx,cpp'
 au BufNewFile *.{h,hpp,hxx} call AddIncludeGuards()
 
+au FileType cpp,c packadd termdebug
+
 augroup autofoldcolumn
   au!
   au CursorHold,BufWinEnter * AutoOrigamiFoldColumn
@@ -181,6 +196,8 @@ augroup END
 
 let g:localvimrc_persistent = 1
 
+let g:fastfold_minlines = 0
+
 au FileType markdown call RagtagInit()
 
 let g:detectspelllang_langs = {}
@@ -294,6 +311,34 @@ let s:normal_mode_mappings = [
       \ ['r', '<denite:redraw>', 'noremap'],
       \ ]
 
+" termdebug split windows
+let g:termdebug_wide = 1
+let termdebugger = $HOME . '/.vim/gdb.sh'
+
+if g:lowendbox == 0
+    if has('nvim-0.5') && $USER != "root"
+lua <<EOF
+        require'nvim-treesitter.configs'.setup {
+            -- one of "all", "maintained" (parsers with maintainers), or a list of languages
+            ensure_installed = "maintained",
+            -- List of parsers to ignore installing
+            ignore_install = { },
+            -- Modules and its options go here
+            highlight = {
+              enable = true,
+              disabled = {}
+            },
+            incremental_selection = {
+              enable = true
+            },
+            textobjects = {
+              enable = true
+            }
+        }
+EOF
+    endif
+endif
+
 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 
 runtime keymaps.vim