commit ddaecabe970facc1db090aac59881a3fd601546e Author: Jali Date: Tue Mar 30 20:01:47 2021 +0200 Initial commit diff --git a/ale.vim b/ale.vim new file mode 100644 index 0000000..2e9101c --- /dev/null +++ b/ale.vim @@ -0,0 +1,14 @@ +" Defines a specific list of linters, that you wish to use for a language +" Install the flake8, python-pylint packages +let g:ale_linters = { + \ 'python': ['flake8', 'pylint'], + \} + +let g:ale_fixers = { + \ 'python': ['yapf'], + \} + +nmap :ALEFix + +let g:ale_fix_on_save = 1 + diff --git a/ginit.vim b/ginit.vim new file mode 100644 index 0000000..52def3c --- /dev/null +++ b/ginit.vim @@ -0,0 +1,22 @@ +let s:fontsize = 10 +function! AdjustFontSize(amount) + let s:fontsize = s:fontsize+a:amount + :execute "GuiFont! Source\ Code\ Pro:h" . s:fontsize +endfunction + +noremap :call AdjustFontSize(1) +noremap :call AdjustFontSize(-1) +inoremap :call AdjustFontSize(1)a +inoremap :call AdjustFontSize(-1)a + +" In normal mode, pressing numpad's+ increases the font +noremap :call AdjustFontSize(1) +noremap :call AdjustFontSize(-1) + +" In insert mode, pressing ctrl + numpad's+ increases the font +inoremap :call AdjustFontSize(1)a +inoremap :call AdjustFontSize(-1)a + +GuiFont! Source\ Code\ Pro:h10 + +set mouse=a diff --git a/gui.vim b/gui.vim new file mode 100644 index 0000000..753869b --- /dev/null +++ b/gui.vim @@ -0,0 +1,5 @@ +set background=dark +let g:solarized_contrast="high" +"colorscheme monokai-phoenix +colorscheme onedark +set t_Co=256 diff --git a/html.vim b/html.vim new file mode 100644 index 0000000..c0dffb0 --- /dev/null +++ b/html.vim @@ -0,0 +1,3 @@ +autocmd! BufNewFile,BufRead *.html call jinja#AdjustFiletype() +autocmd! BufNewFile,BufRead *.htm call jinja#AdjustFiletype() +autocmd! BufNewFile,BufRead *.xhtml call jinja#AdjustFiletype() diff --git a/init.vim b/init.vim new file mode 100644 index 0000000..6e635f9 --- /dev/null +++ b/init.vim @@ -0,0 +1,72 @@ +" General settings +" + +set nocompatible +set bs=2 "set backspace to be able to delete previous characters +let mapleader = "," "Set the leader from \ to , + +" Enable line numbering +set number + +" No word wrapping +set wrap! + +" Encoding is UTF-8 + +" Autosave all unsaved buffers when the window loses focus +au FocusLost * :wa + +" Set defaults for syntax highlight +filetype off + +" Set tab char to 4 spaces, not 8 +set tabstop=4 + +" Turn tabs into whitespaces +set expandtab + +" Indent width for autoindent, C friendly +set shiftwidth=4 + +" Indent depends on filed +filetype plugin indent on + +"Turn on incremental search +set incsearch +set ignorecase +set smartcase + +"Informative statusline +set statusline=%F%m%r%h%w\ [TYPE=%Y\ %{&ff}]\ [%02l:%02v\ (%p%%)\ %L\ Lines]\ [ASCII=\%03.3b]\ [HEX=\%02.2B] +set laststatus=2 + +" Beautify the look and feel +syntax on + +" always use the clipboard, instead of the internal * and + registers +set clipboard+=unnamedplus + +" Disable spell checking in terminal windows +autocmd TermOpen * setlocal nospell nonumber norelativenumber + +" Switch buffers with and - +nnoremap :if &modifiable && !&readonly && &modified :write :endif:bnext +nnoremap :if &modifiable && !&readonly && &modified :write :endif:bprevious + +" toggle folding in normal mode with +nnoremap za +nnoremap zA + +let &packpath = &runtimepath +source ~/.config/nvim/plug.vim +source ~/.config/nvim/gui.vim +source ~/.config/nvim/latex.vim +source ~/.config/nvim/markdown.vim +source ~/.config/nvim/wiki.vim +source ~/.config/nvim/rainbow.vim +source ~/.config/nvim/neomake.vim +source ~/.config/nvim/keymap.vim +source ~/.config/nvim/timestamp.vim +source ~/.config/nvim/ale.vim +source ~/.config/nvim/html.vim +source ~/.config/nvim/python.vim diff --git a/keymap.vim b/keymap.vim new file mode 100644 index 0000000..a4ba18c --- /dev/null +++ b/keymap.vim @@ -0,0 +1,20 @@ +" Custom keymappings + +" Toggle through open buffers via F8 +noremap :bnext +noremap :bprevious + +" Define a shortcut to turn on NERDTree +map :NERDTreeToggle + +" Copy to clipboard with Ctrl+C when in visual mode +vnoremap "+y + +" Copy to clipboard with Ctrl+C when in normal mode +noremap "+y + +" Paste from clipboard with Ctrl+V when in insert or command mode +map! "+p + +" Open the terminal in a separate window +noremap :belowright split term://zsh diff --git a/latex.vim b/latex.vim new file mode 100644 index 0000000..c1901a7 --- /dev/null +++ b/latex.vim @@ -0,0 +1,8 @@ +" Settings for using LaTeX +set grepprg=grep\ -nH\ $* +let g:tex_flavor='latex' +set iskeyword+=: +autocmd BufRead *.tex set tw=100 +autocmd BufRead *.tex set spell +autocmd BufRead,BufEnter *.tex map :w :!/usr/bin/waf configure build +autocmd BufRead,BufEnter *.tex let b:AutoPairs = {'(':')', '[':']', '{':'}'} diff --git a/markdown.vim b/markdown.vim new file mode 100644 index 0000000..69f42f2 --- /dev/null +++ b/markdown.vim @@ -0,0 +1,5 @@ +" Settings for markdown +set grepprg=grep\ -nH\ $* +autocmd BufRead *.md set tw=80 +autocmd BufRead *.md set spell + diff --git a/modula2.vim b/modula2.vim new file mode 100644 index 0000000..dbbacaf --- /dev/null +++ b/modula2.vim @@ -0,0 +1 @@ +" forces files that end in .mod or diff --git a/neomake.vim b/neomake.vim new file mode 100644 index 0000000..ec591ff --- /dev/null +++ b/neomake.vim @@ -0,0 +1,9 @@ +" When writing a buffer (no delay). +call neomake#configure#automake('w') +" When writing a buffer (no delay), and on normal mode changes (after 750ms). +call neomake#configure#automake('nw', 750) +" When reading a buffer (after 1s), and when writing (no delay). +call neomake#configure#automake('rw', 1000) +" Full config: when writing or reading a buffer, and on changes in insert and +" normal mode (after 500ms; no delay when writing). +call neomake#configure#automake('nrwi', 500) diff --git a/plug.vim b/plug.vim new file mode 100644 index 0000000..acf77fe --- /dev/null +++ b/plug.vim @@ -0,0 +1,40 @@ +" Specify a directory for plugins +call plug#begin(stdpath('data') . '/plugged') +Plug 'kyoz/purify', { 'rtp': 'vim' } + +" Colourthemes +Plug 'joshdick/onedark.vim' + +" Editor extensions +Plug 'neomake/neomake' +Plug 'preservim/nerdtree' +Plug 'airblade/vim-gitgutter' +Plug 'zhaocai/timestamp.vim' +Plug 'vim-airline/vim-airline' +Plug 'bling/vim-bufferline' +Plug 'junegunn/fzf.vim' +Plug 'tpope/vim-commentary' + +" Use rainbow parenthesis and automatic closing parens +Plug 'luochen1990/rainbow' +Plug 'jiangmiao/auto-pairs' + +" Linting plugin for multiple languages +Plug 'dense-analysis/ale' + +" Language support for LaTeX +Plug 'vim-latex/vim-latex' + +" Syntaxhighlighting for mediawiki code +Plug 'chikamichi/mediawiki.vim' + +" Syntaxhighlighting for .toml files +Plug 'cespare/vim-toml' + +" Extras for python coding +Plug 'jeetsukumaran/vim-pythonsense' +Plug 'numirias/semshi', {'do': ':UpdateRemotePlugins'} +Plug 'Vimjas/vim-python-pep8-indent' +Plug 'davidhalter/jedi-vim' +Plug 'HiPhish/jinja.vim' +call plug#end() diff --git a/python.vim b/python.vim new file mode 100644 index 0000000..731d03d --- /dev/null +++ b/python.vim @@ -0,0 +1,5 @@ +" Set the fold method to indent for python code +au BufNewFile,BufRead *.py + \ setlocal foldmethod=indent + \ nospell + diff --git a/rainbow.vim b/rainbow.vim new file mode 100644 index 0000000..1a16d2e --- /dev/null +++ b/rainbow.vim @@ -0,0 +1,2 @@ +" Use rainbow paranthesis +let g:rainbow_active=1 diff --git a/timestamp.vim b/timestamp.vim new file mode 100644 index 0000000..2f7d361 --- /dev/null +++ b/timestamp.vim @@ -0,0 +1,2 @@ +autocmd VimEnter * EnableTimestamp + diff --git a/wiki.vim b/wiki.vim new file mode 100644 index 0000000..9604041 --- /dev/null +++ b/wiki.vim @@ -0,0 +1,4 @@ +" Settings for wiki syntax +set grepprg=grep\ -nH\ $* +autocmd BufRead *.wiki set tw=80 +autocmd BufRead *.wiki set spell