From 5f169d2cc111dbb4d5f9165f28970ca698c63e43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Wo=C5=BAniak?= Date: Tue, 1 Sep 2020 11:39:56 +0200 Subject: [PATCH] Updated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcin Woźniak --- .emacs.d/emacs-custom.el | 2 +- .emacs.d/init.el | 11 +++++ .vimrc | 58 ++++++++++++++++++++++++-- .vimrc-def | 89 ++++++++++++++++++++++++++++++++++++++++ .zshrc | 2 +- 5 files changed, 157 insertions(+), 5 deletions(-) create mode 100644 .vimrc-def diff --git a/.emacs.d/emacs-custom.el b/.emacs.d/emacs-custom.el index 1e43e6e..2bd4b17 100644 --- a/.emacs.d/emacs-custom.el +++ b/.emacs.d/emacs-custom.el @@ -9,7 +9,7 @@ '(livedown-port 1337) '(package-selected-packages (quote - (dired-sidebar use-package switch-window ox-reveal ox-jira markdown-mode magit htmlize dracula-theme confluence)))) + (org-jira use-package switch-window ox-reveal ox-jira markdown-mode magit htmlize dracula-theme dired-sidebar confluence)))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 2b0d8d1..20dd203 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -43,6 +43,11 @@ (add-hook 'org-mode-hook '(lambda () (setq fill-column 80))) (add-hook 'org-mode-hook 'auto-fill-mode) +;; Broswer +(setq browse-url-browser-function 'browse-url-generic + browse-url-generic-program "browser-x") + + ;; Switch-window (use-package switch-window :ensure t @@ -72,6 +77,12 @@ (setq org-reveal-root "https://cdn.jsdelivr.net/npm/reveal.js") ) +;; Org-Jira +;(use-package org-jira +; :ensure t +; ) +;(setq jiralib-url "https://localhost/") + ;; Theme (use-package dracula-theme :ensure t diff --git a/.vimrc b/.vimrc index 5b9e048..758ef08 100644 --- a/.vimrc +++ b/.vimrc @@ -13,9 +13,32 @@ au BufWritePre * let &bex = '@' . strftime("%F.%H:%M") " plugins call plug#begin('~/.vim/plugged') -Plug 'preservim/nerdtree', "{ 'on': 'NERDTreeToggle' } +Plug 'preservim/nerdtree' +Plug 'y0rune/vimwiki' +Plug 'nmante/vim-latex-live-preview' +Plug 'lervag/vimtex' +Plug 'junegunn/goyo.vim' +Plug 'jceb/vim-orgmode' +Plug 'tpope/vim-speeddating' +Plug 'prettier/vim-prettier', { 'do': 'npm install --force' } +Plug 'iamcco/markdown-preview.nvim', { 'do': 'npm install --force' } +" Problem with vim-prettier +" +" git checkout -b test origin/feature/issue-232-add-support-for-prettier-2.x; +" npm install --force call plug#end() +" Vim wiki +let wiki = {} +let wiki.path = '~/git/notes/' +let wiki.path_html = '~/git/notes/www/' +let wiki.syntax = 'default' +let wiki.ext = '.wiki' +let text_ignore_newline = 0 +let g:vimwiki_list = [wiki] +let g:vimwiki_list_ignore_newline = 1 +let g:vimwiki_table_mappings = 0 + " Status-line set statusline= set statusline+=%#IncSearch# @@ -32,12 +55,15 @@ set nocompatible set hlsearch set incsearch set noshowmode +set cursorline set cmdheight=1 syntax on filetype plugin indent on - set encoding=utf-8 +" livepreviewer +let g:livepreview_previewer = 'mupdf' + " line numbers set number set ruler @@ -50,6 +76,7 @@ set expandtab " editing runtime! macros/matchit.vim +set backspace=indent,eol,start " visual feedback set laststatus=2 @@ -72,18 +99,43 @@ let &t_SI = "\[6 q" let &t_EI = "\[2 q" " colors -set bg=dark colorscheme desert +hi CursorLine cterm=NONE term=NONE ctermbg=NONE guibg=NONE +hi CursorLine ctermbg=235 " map nnoremap S :%s//g +nnoremap ee :!mupdf $(echo % \| sed 's/tex$/pdf/') & disown map :NERDTreeToggle nnoremap :tabnew +nnoremap :Goyo nnoremap :tabprevious nnoremap :tabnext cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' 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 | set bg=light +autocmd BufRead,BufNewFile /tmp/neomutt* map ZZ :Goyo\|x! +autocmd BufRead,BufNewFile /tmp/neomutt* map ZQ :Goyo\|q! + " 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 + +" Livedown +let g:livedown_browser = "browser-x" +let g:livedown_autorun = 0 +let g:livedown_open = 1 +let g:livedown_port = 4242 diff --git a/.vimrc-def b/.vimrc-def new file mode 100644 index 0000000..5b9e048 --- /dev/null +++ b/.vimrc-def @@ -0,0 +1,89 @@ +" settings +if ! filereadable(system('echo -n "$HOME/.vim/autoload/plug.vim"')) + silent !mkdir -p $HOME/.vim/autoload/ + silent !curl --silent "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > $HOME/.vim/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('~/.vim/plugged') +Plug 'preservim/nerdtree', "{ 'on': 'NERDTreeToggle' } +call plug#end() + +" 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 + +" line numbers +set number +set ruler +set title + +" indent +set backspace=indent,eol,start +set shiftwidth=4 +set expandtab + +" editing +runtime! macros/matchit.vim + +" visual feedback +set laststatus=2 +set showmode +set showcmd + +" off mouse +set mouse-=a + +" disable pcspkr beep +set visualbell +set t_vb= + +" searching +set incsearch +set smartcase + +" cursor +let &t_SI = "\[6 q" +let &t_EI = "\[2 q" + +" colors +set bg=dark +colorscheme desert + +" map +nnoremap S :%s//g +map :NERDTreeToggle +nnoremap :tabnew +nnoremap :tabprevious +nnoremap :tabnext + +cnoremap w!! execute 'silent! write !sudo tee % >/dev/null' edit! + +" Automatically deletes all trailing whitespace and newlines at end of file on save. +autocmd BufWritePre * %s/\s\+$//e +autocmd BufWritepre * %s/\n\+\%$//e diff --git a/.zshrc b/.zshrc index 3ee057f..bd55885 100644 --- a/.zshrc +++ b/.zshrc @@ -82,7 +82,7 @@ alias vpnd="sudo /root/.local/bin/protonvpn d" alias prolog="swipl" alias tv="~/MEGA/tv/tv.sh" alias newswork="newsboat --url=$HOME/.config/newsboat/urlswork" -alias vim="vim -u $HOME/.vimrc-gentoo -p" +alias vim="vim -p" alias denpl="trans en:pl" alias dplen="trans pl:en" alias notes="vim $HOME/git/notes/index.md"