Signed-off-by: Marcin Woźniak <y0rune@aol.com>
This commit is contained in:
Marcin Woźniak 2020-10-29 22:08:29 +01:00
parent 0456d713b6
commit e05ed5a769
Signed by: y0rune
GPG Key ID: F204C385F57EB348
3 changed files with 156 additions and 4 deletions

146
.config/nvim/init.vim Normal file
View File

@ -0,0 +1,146 @@
" settings
if ! filereadable(system('echo -n "$HOME/.config/nvim/autoload/plug.vim"'))
silent !mkdir -p $HOME/.config/nvim/autoload/
silent !curl --silent "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > $HOME/.config/nvim/autoload/plug.vim
autocmd VimEnter * PlugInstall
endif
set laststatus=2
set shiftwidth=4
set softtabstop=4
set tabstop=4
au BufWritePre * let &bex = '@' . strftime("%F.%H:%M")
" plugins
call plug#begin('~/.config/nvim/plugged')
Plug 'preservim/nerdtree'
Plug 'nmante/vim-latex-live-preview'
Plug 'lervag/vimtex'
Plug 'junegunn/goyo.vim'
Plug 'jceb/vim-orgmode'
Plug 'prettier/vim-prettier', { 'do': 'npm install --force' }
Plug 'iamcco/markdown-preview.nvim', { 'do': 'npm install --force' }
" Autocomplete
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'vim-syntastic/syntastic'
Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc'
" Ruby
Plug 'takkii/Bignyanco'
Plug 'vim-ruby/vim-ruby'
"
" Problem with vim-prettier
" git checkout -b test origin/feature/issue-232-add-support-for-prettier-2.x;
" npm install --force
"
" Problem autocomplete
" pip3 install --user pynvim
" pip install msgpack --user
call plug#end()
let g:deoplete#enable_at_startup = 1
" Pass a dictionary to set multiple options
call deoplete#custom#option({
\ 'auto_complete_delay': 200,
\ 'smart_case': v:true,
\ 'max_list' : 10,
\ })
" Status-line
set statusline=
set statusline+=%#IncSearch#
set statusline+=\ %y
set statusline+=\ %r
set statusline+=%#CursorLineNr#
set statusline+=\ %F
set statusline+=%= "Right side settings
set statusline+=%#Search#
set statusline+=\ %l/%L
set statusline+=\ [%c]
set nocompatible
set hlsearch
set incsearch
set noshowmode
set cmdheight=1
syntax on
filetype plugin indent on
set encoding=utf-8
" livepreviewer
let g:livepreview_previewer = 'mupdf'
" markdown preview
let g:mkdp_browser = '/home/yorune/.local/bin/browser-x'
let g:mkdp_echo_preview_url = 1
" line numbers
set number
set ruler
set title
" indent
set backspace=indent,eol,start
set shiftwidth=4
set expandtab
" editing
runtime! macros/matchit.vim
set backspace=indent,eol,start
" visual feedback
set laststatus=2
set showmode
set showcmd
" off mouse
set mouse-=a
" disable pcspkr beep
set visualbell
set t_vb=
" searching
set smartcase
set ic
" cursor
let &t_SI = "\<esc>[6 q"
let &t_EI = "\<esc>[2 q"
" colors
set bg=dark
hi CursorLine cterm=NONE term=NONE ctermbg=NONE guibg=NONE
hi CursorLine ctermbg=235
" map
nnoremap S :%s//g<Left><Left>
nnoremap ee :!mupdf $(echo % \| sed 's/tex$/pdf/') & disown<CR><CR>
map <C-n> :NERDTreeToggle<CR>
nnoremap <silent> <C-t> :tabnew <CR>
nnoremap <F11> :Goyo <CR>
nnoremap <F7> :tabprevious<CR>
nnoremap <F8> :tabnext<CR>
cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' <bar> edit!
" latex
let g:tex_flavor = "latex"
autocmd BufWritePost *.tex silent! execute "!pdflatex --shell-escape -synctex=1 -interaction=nonstopmode % > /dev/null " | redraw!
autocmd BufWritePost *.tex silent! execute "!latexmk -pdf -silent % > /dev/null" | redraw!
autocmd BufWritePost *.tex silent! execute "!sudo rm -rf *.fls *.ilg *.nav *.snm *.toc *.idx *.lof *.lot *.synctex.gz *.aux *.fdb_latexmk *.fls *.log *.out > /dev/null" | redraw!
autocmd BufWritePost *.tex silent! execute "!sudo pkill -HUP mupdf > /dev/null" | redraw!
" mutt
autocmd BufRead,BufNewFile /tmp/neomutt* let g:goyo_width=80
autocmd BufRead,BufNewFile /tmp/neomutt* :Goyo
autocmd BufRead,BufNewFile /tmp/neomutt* map ZZ :Goyo\|x!<CR>
autocmd BufRead,BufNewFile /tmp/neomutt* map ZQ :Goyo\|q!<CR>
" Automatically deletes all trailing whitespace and newlines at end of file on save.
autocmd BufWritePre * %s/\s\+$//e
autocmd BufWritepre * %s/\n\+\%$//e
" Autoformating markdown
autocmd BufWritePost *.md :Prettier

12
.vimrc
View File

@ -21,15 +21,21 @@ Plug 'jceb/vim-orgmode'
Plug 'tpope/vim-speeddating' Plug 'tpope/vim-speeddating'
Plug 'prettier/vim-prettier', { 'do': 'npm install --force' } Plug 'prettier/vim-prettier', { 'do': 'npm install --force' }
Plug 'iamcco/markdown-preview.nvim', { 'do': 'npm install --force' } Plug 'iamcco/markdown-preview.nvim', { 'do': 'npm install --force' }
Plug 'ycm-core/YouCompleteMe', { 'do': 'python3 install.py --clangd-completer --java-completer'} Plug 'vim-ruby/vim-ruby'
Plug 'hashivim/vim-terraform'
Plug 'vim-syntastic/syntastic' Plug 'vim-syntastic/syntastic'
Plug 'juliosueiras/vim-terraform-completion' Plug 'Shougo/deoplete.nvim'
Plug 'takkii/Bignyanco'
Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc'
" Problem with vim-prettier " Problem with vim-prettier
" git checkout -b test origin/feature/issue-232-add-support-for-prettier-2.x; " git checkout -b test origin/feature/issue-232-add-support-for-prettier-2.x;
" npm install --force " npm install --force
call plug#end() call plug#end()
let g:rubycomplete_buffer_loading = 1
let g:rubycomplete_rails = 1
" Status-line " Status-line
set statusline= set statusline=
set statusline+=%#IncSearch# set statusline+=%#IncSearch#

2
.zshrc
View File

@ -87,7 +87,7 @@ alias vpnd="sudo /root/.local/bin/protonvpn d"
alias prolog="swipl" alias prolog="swipl"
alias tv="~/MEGA/tv/tv.sh" alias tv="~/MEGA/tv/tv.sh"
alias newswork="newsboat --url=$HOME/.config/newsboat/urlswork" alias newswork="newsboat --url=$HOME/.config/newsboat/urlswork"
alias vim="vim -p" alias vim="nvim -p"
alias denpl="trans en:pl" alias denpl="trans en:pl"
alias dplen="trans pl:en" alias dplen="trans pl:en"
alias notes="vim $HOME/git/notes/index.md" alias notes="vim $HOME/git/notes/index.md"