summaryrefslogtreecommitdiff
path: root/init.vim
diff options
context:
space:
mode:
authorMarius Peter <marius.peter@tutanota.com>2023-12-11 18:42:54 +0100
committerMarius Peter <marius.peter@tutanota.com>2023-12-11 18:42:54 +0100
commitf045c56c5d262cb12c6dbe2959e648f9027e550f (patch)
treeb28cca2d410d1e23e4158b9d7f642a2806e8c262 /init.vim
parent6a27402ff50c7876f2f81017606a0624bb88a4fe (diff)
Add Vim configuration file.HEADmaster
Diffstat (limited to 'init.vim')
-rw-r--r--init.vim125
1 files changed, 125 insertions, 0 deletions
diff --git a/init.vim b/init.vim
new file mode 100644
index 0000000..24a97cb
--- /dev/null
+++ b/init.vim
@@ -0,0 +1,125 @@
+" ____ __ __ _ __ _ _
+" / __ )/ /__ ____ ____/ /___ (_) /( )_____ _ __(_)___ ___ __________
+" / __ / / _ \/ __ \/ __ / __ \/ / __/// ___/ | | / / / __ `__ \/ ___/ ___/
+" / /_/ / / __/ / / / /_/ / /_/ / / /_ (__ ) _| |/ / / / / / / / / / /__
+" /_____/_/\___/_/ /_/\__,_/\____/_/\__/ /____/ (_)___/_/_/ /_/ /_/_/ \___/
+
+"Clear all autocommands
+:autocmd!
+let mapleader=";"
+
+"$VIMRC
+autocmd bufwritepost ~/.config/nvim/init.vim source %
+nnoremap <leader><leader> :e ~/.config/nvim/init.vim<CR>
+"Vim files
+set backup
+set swapfile
+set undofile
+set backupdir=~/.local/share/nvim/backup// "Tilda file
+set directory=~/.local/share/nvim/swap// "Swap file
+set undodir=~/.local/share/nvim/undo// "Undo file
+set undolevels=200
+set undoreload=2000
+
+"Basic settings
+filetype plugin on
+syntax on
+set number relativenumber
+set scrolloff=4 "Show 3 lines below / above the cursor
+"File encoding
+set encoding=utf-8
+set fileencoding=utf-8
+"Tabs
+set showtabline=2
+set tabstop=8 softtabstop=0 expandtab shiftwidth=4 smarttab
+set autoindent
+set smartindent
+
+"Code folding
+set foldmethod=indent
+set nofoldenable
+set foldnestmax=10
+set foldlevel=2
+
+"Navigation
+"Vim
+"nnoremap ZW :w<CR>
+nnoremap <leader>q :q<CR>
+nnoremap <leader>w :w<CR>
+nnoremap <leader>x :x<CR>
+"Buffer
+nnoremap <leader>j :bn<CR>
+nnoremap <leader>k :bp<CR>
+nnoremap <leader>d :bd<CR>
+nnoremap <leader>b :buffers<CR>
+"Windows
+"nnoremap <C-h> <C-w>h
+"nnoremap <C-j> <C-w>j
+"nnoremap <C-k> <C-w>k
+"nnoremap <C-l> <C-w>l
+"Tabs
+nnoremap <leader>h :tabp<CR>
+nnoremap <leader>l :tabn<CR>
+nnoremap <leader>t :tabnew<CR>
+
+"netrw
+"nnoremap <leader>e :E<CR>
+"nnoremap <leader>s :S<CR>
+"nnoremap <leader>v :vsplit<CR>
+"nnoremap <leader>o :browse oldfiles<CR>
+
+"Plugins
+call plug#begin('~/.local/share/nvim/vim-plug-blendoit')
+Plug 'lervag/vimtex'
+Plug 'vimwiki/vimwiki'
+Plug 'vim-airline/vim-airline'
+Plug 'vim-airline/vim-airline-themes'
+Plug 'vim-pandoc/vim-pandoc'
+Plug 'vim-pandoc/vim-pandoc-syntax'
+Plug 'junegunn/limelight.vim'
+Plug 'junegunn/goyo.vim'
+Plug 'dhruvasagar/vim-table-mode'
+Plug 'mbbill/undotree'
+call plug#end()
+
+"Airline
+let g:airline_theme='papercolor'
+let g:airline#extensions#tabline#enabled=1
+
+"Pandoc
+"let g:pandoc#command#autoexec_command = "Pandoc! pdf"
+let g:pandoc#filetypes#handled = ["pandoc", "markdown"]
+let g:pandoc#filetypes#pandoc_markdown = 0
+let g:pandoc#command#custom_open = "zathura"
+
+"Goyo/Limelight
+nnoremap <leader>g :Goyo<CR>
+autocmd! User GoyoEnter Limelight
+autocmd! User GoyoLeave Limelight!
+let g:limelight_conceal_ctermfg = 'gray'
+let g:limelight_conceal_ctermfg = 240
+
+"Table mode
+let g:table_mode_corner_corner='+'
+let g:table_mode_header_fillchar='='
+
+"FZF
+nnoremap <leader>f :FZF<CR>
+
+"Undotree
+nnoremap <leader>u :UndotreeToggle<CR>
+
+"writing shortcuts
+"Jump to next tag <++>
+inoremap <leader><leader> <Esc>/<++><CR>"_c4l
+
+"LaTeX
+let g:vimtex_view_general_viewer='zathura'
+autocmd FileType tex nnoremap <leader>c :VimtexCompile<CR>
+"Insert mode
+autocmd FileType tex inoremap <leader>i \textit{}<Space><++><Esc>T{i
+autocmd FileType tex inoremap <leader>b \textbf{}<Space><++><Esc>T{i
+autocmd FileType tex inoremap <leader>e \emph{}<Space><++><Esc>T{i
+autocmd FileType tex inoremap <leader>t <Esc>bdwo\begin{<Esc>pa}<CR>\end{<Esc>pa}<++><Esc>O
+autocmd FileType tex inoremap <leader>l \item
+autocmd FileType tex inoremap <leader>s \textsc{}<Space><++><Esc>T{i \ No newline at end of file
Copyright 2019--2024 Marius PETER