Initial commit

This commit is contained in:
2021-03-30 20:01:47 +02:00
commit ddaecabe97
15 changed files with 212 additions and 0 deletions

14
ale.vim Normal file
View File

@@ -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 <F10> :ALEFix<CR>
let g:ale_fix_on_save = 1

22
ginit.vim Normal file
View File

@@ -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 <C-ScrollWheelUp> :call AdjustFontSize(1)<CR>
noremap <C-ScrollWheelDown> :call AdjustFontSize(-1)<CR>
inoremap <C-ScrollWheelUp> <Esc>:call AdjustFontSize(1)<CR>a
inoremap <C-ScrollWheelDown> <Esc>:call AdjustFontSize(-1)<CR>a
" In normal mode, pressing numpad's+ increases the font
noremap <kPlus> :call AdjustFontSize(1)<CR>
noremap <kMinus> :call AdjustFontSize(-1)<CR>
" In insert mode, pressing ctrl + numpad's+ increases the font
inoremap <C-kPlus> <Esc>:call AdjustFontSize(1)<CR>a
inoremap <C-kMinus> <Esc>:call AdjustFontSize(-1)<CR>a
GuiFont! Source\ Code\ Pro:h10
set mouse=a

5
gui.vim Normal file
View File

@@ -0,0 +1,5 @@
set background=dark
let g:solarized_contrast="high"
"colorscheme monokai-phoenix
colorscheme onedark
set t_Co=256

3
html.vim Normal file
View File

@@ -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()

72
init.vim Normal file
View File

@@ -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 <TAB> and <S>-<TAB>
nnoremap <silent> <tab> :if &modifiable && !&readonly && &modified <CR> :write<CR> :endif<CR>:bnext<CR>
nnoremap <silent> <s-tab> :if &modifiable && !&readonly && &modified <CR> :write<CR> :endif<CR>:bprevious<CR>
" toggle folding in normal mode with <space>
nnoremap <space> za
nnoremap <S-space> 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

20
keymap.vim Normal file
View File

@@ -0,0 +1,20 @@
" Custom keymappings
" Toggle through open buffers via F8
noremap <F8> :bnext <CR>
noremap <S-F8> :bprevious <CR>
" Define a shortcut to turn on NERDTree
map <C-n> :NERDTreeToggle <CR>
" Copy to clipboard with Ctrl+C when in visual mode
vnoremap <C-c> "+y
" Copy to clipboard with Ctrl+C when in normal mode
noremap <C-c> "+y
" Paste from clipboard with Ctrl+V when in insert or command mode
map! <C-v> <C-o>"+p
" Open the terminal in a separate window
noremap <A-t> :belowright split term://zsh<CR>

8
latex.vim Normal file
View File

@@ -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 <F9> :w <CR> :!/usr/bin/waf configure build <CR>
autocmd BufRead,BufEnter *.tex let b:AutoPairs = {'(':')', '[':']', '{':'}'}

5
markdown.vim Normal file
View File

@@ -0,0 +1,5 @@
" Settings for markdown
set grepprg=grep\ -nH\ $*
autocmd BufRead *.md set tw=80
autocmd BufRead *.md set spell

1
modula2.vim Normal file
View File

@@ -0,0 +1 @@
" forces files that end in .mod or

9
neomake.vim Normal file
View File

@@ -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)

40
plug.vim Normal file
View File

@@ -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()

5
python.vim Normal file
View File

@@ -0,0 +1,5 @@
" Set the fold method to indent for python code
au BufNewFile,BufRead *.py
\ setlocal foldmethod=indent
\ nospell

2
rainbow.vim Normal file
View File

@@ -0,0 +1,2 @@
" Use rainbow paranthesis
let g:rainbow_active=1

2
timestamp.vim Normal file
View File

@@ -0,0 +1,2 @@
autocmd VimEnter * EnableTimestamp

4
wiki.vim Normal file
View File

@@ -0,0 +1,4 @@
" Settings for wiki syntax
set grepprg=grep\ -nH\ $*
autocmd BufRead *.wiki set tw=80
autocmd BufRead *.wiki set spell