diff options
Diffstat (limited to '.config/nvim')
-rw-r--r-- | .config/nvim/UltiSnips/rnoweb.snippets | 122 | ||||
-rw-r--r-- | .config/nvim/ftplugin/csv.vim | 0 | ||||
-rw-r--r-- | .config/nvim/ftplugin/go.vim | 17 | ||||
-rw-r--r-- | .config/nvim/ftplugin/python.vim | 0 | ||||
-rw-r--r-- | .config/nvim/ftplugin/r.vim | 4 | ||||
-rw-r--r-- | .config/nvim/ftplugin/rmd.vim | 6 | ||||
-rw-r--r-- | .config/nvim/ftplugin/rnoweb.vim | 8 | ||||
-rw-r--r-- | .config/nvim/ftplugin/tex.vim | 0 | ||||
-rwxr-xr-x | .config/nvim/init.vim | 53 |
9 files changed, 39 insertions, 171 deletions
diff --git a/.config/nvim/UltiSnips/rnoweb.snippets b/.config/nvim/UltiSnips/rnoweb.snippets deleted file mode 100644 index b0e4906..0000000 --- a/.config/nvim/UltiSnips/rnoweb.snippets +++ /dev/null @@ -1,122 +0,0 @@ -snippet begin "Begin/End Environments" -\begin{${1:element}} -${2:contents} -\end{$1} - -endsnippet - -snippet v "Import R variable in LaTeX" -\Sexpr{${1:var}} -endsnippet - -snippet eqn "Floating Equation" -\begin{eqfloat}[H] -\begin{align} - ${3:E} &= ${4:mc^2} -\end{align} -cond$5 -\label{eqn:${2:title}} -\caption{${1:A Title}} -\end{eqfloat} - -endsnippet - -snippet x "Multiplication Dot" -\cdot -endsnippet - -snippet e "Scientific Notation" -\cdot10^{${1:power}} -endsnippet - -snippet cond "Conditions for Equations" -\begin{conditions} - ${1:V} & ${2:Definition of V} -\end{conditions} -endsnippet - -snippet R "R Code" -<<label='${1:label}',echo=${2:FALSE},results='${3:asis}'>>= -${4:1+1} -@ -endsnippet - -snippet csv "Import CSV in R" -${1:variable_vame} <- read.csv("${2:path/to/file}.csv", -header=${3:TRUE}, -sep="${4:;}" -) - -endsnippet - -snippet xtable "Table made from R matrix" -print( - xtable(${1:matrix_name}, - caption="${2:Title of the table}", - label="tab:${3:table}", - digits=matrix($6 - c( -`!p -from time import sleep -try: - col = int(t[3])-1 - paragraph = "" - for i in range(int(t[4])-1): - paragraph += " rep(0,"+str(col)+"), <++>,\n" - paragraph += " rep(0,"+str(col)+"), <++>" - snip.rv = paragraph -except(ValueError): - sleep(1) -# paragraph = "" -# paragraph = " rep(0,"+t[3]+"), 0,\n" -# for i in range(int(t[4])-2): -# paragraph += " rep(0,"+t[3]+"), <++>,\n" -# paragraph += " rep(0,"+t[3]+"), <++>" -# snip.rv = paragraph -` - ), - nrow=${5:6}, - ncol=${4:3}, - byrow=TRUE - ), - table.placement="H" - ), - include.rownames=FALSE, - table.placement="H" -) - -endsnippet - -snippet img "Image" -\begin{figure}[H] -\begin{center} -\includegraphics[scale=${1:1}]{${2:path/to/image}} -\label{fig:${3/\s/_/g}} -\caption{${3:A Title}} -\end{center} -\end{figure} -endsnippet - -snippet b "Bold" -\textbf{${1:text}} -endsnippet - -snippet i "Italix" -\textit{${1:text}} -endsnippet - -snippet u "Underline" -\uline{${1:text}} -endsnippet - -snippet 1 "Section" -\section{${1:Title}} -endsnippet - -snippet 2 "Subsection" -\subsection{${1:Title}} -endsnippet - -snippet 3 "Subsubsection" -\subsubsection{${1:Title}} -endsnippet diff --git a/.config/nvim/ftplugin/csv.vim b/.config/nvim/ftplugin/csv.vim new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.config/nvim/ftplugin/csv.vim diff --git a/.config/nvim/ftplugin/go.vim b/.config/nvim/ftplugin/go.vim new file mode 100644 index 0000000..9d2ab4e --- /dev/null +++ b/.config/nvim/ftplugin/go.vim @@ -0,0 +1,17 @@ +" Go deoplete +let g:deoplete#sources#go#gocode_binary = '$GOPATH/bin/gocode' +" GoRun Split Reuse +function! ReuseVimGoTerm(cmd) abort + for w in nvim_list_wins() + if "goterm" == nvim_buf_get_option(nvim_win_get_buf(w), 'filetype') + call nvim_win_close(w, v:true) + break + endif + endfor + execute a:cmd +endfunction +let g:go_term_enabled = 1 +let g:go_term_mode = "silent keepalt rightbelow 35 vsplit" +let g:go_def_reuse_buffer = 1 +autocmd FileType go nmap <leader>r :call ReuseVimGoTerm('GoRun')<Return> + diff --git a/.config/nvim/ftplugin/python.vim b/.config/nvim/ftplugin/python.vim new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.config/nvim/ftplugin/python.vim diff --git a/.config/nvim/ftplugin/r.vim b/.config/nvim/ftplugin/r.vim new file mode 100644 index 0000000..309483b --- /dev/null +++ b/.config/nvim/ftplugin/r.vim @@ -0,0 +1,4 @@ +" Nvim-R +let R_rconsole_width = 0 +let R_openpdf = 0 + diff --git a/.config/nvim/ftplugin/rmd.vim b/.config/nvim/ftplugin/rmd.vim new file mode 100644 index 0000000..fae453d --- /dev/null +++ b/.config/nvim/ftplugin/rmd.vim @@ -0,0 +1,6 @@ +" Nvim-R +let R_rconsole_width = 0 +let R_openpdf = 0 +au BufWritePost *.rmd silent! :call RWeave("nobib", 1, 1) +au VimLeave *.rmd !texclear % + diff --git a/.config/nvim/ftplugin/rnoweb.vim b/.config/nvim/ftplugin/rnoweb.vim new file mode 100644 index 0000000..f4b7453 --- /dev/null +++ b/.config/nvim/ftplugin/rnoweb.vim @@ -0,0 +1,8 @@ +autocmd BufEnter * :UltiSnipsAddFiletypes tex.r + +" Nvim-R +let R_rconsole_width = 0 +let R_openpdf = 0 +au BufWritePost *.rnw, silent! :call RWeave("nobib", 1, 1) +au VimLeave *.rnw !texclear % + diff --git a/.config/nvim/ftplugin/tex.vim b/.config/nvim/ftplugin/tex.vim new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/.config/nvim/ftplugin/tex.vim diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 269f0f6..8894158 100755 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -6,6 +6,8 @@ " \_/ |_|_| |_| |_|_| \___| " " + + " #---Plug Installer---# " if empty(glob('~/.vim/autoload/plug.vim')) silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs @@ -43,8 +45,6 @@ Plug 'kiteco/vim-plugin' Plug 'stevearc/vim-arduino' " Vim org tables Plug 'dhruvasagar/vim-table-mode' -" Html linter enabler (for prettier AUR package) -Plug 'dense-analysis/ale' " Vim css hex highlight Plug 'chrisbra/Colorizer' " Bracket Completion @@ -89,10 +89,6 @@ Plug 'lervag/vimtex' " Plug 'ludovicchabant/vim-gutentags' " C developement in vim Plug 'vim-scripts/c.vim' -" NERDTree -Plug 'scrooloose/nerdtree' -" Git plugin for NERDTree -Plug 'Xuyuanp/nerdtree-git-plugin' " Icons in NERDTree and Airline Plug 'ryanoasis/vim-devicons' " lightline @@ -146,11 +142,6 @@ set wrap set linebreak " #---Plugin Preferences---# " -" Nvim-R -let R_rconsole_width = 0 -let R_openpdf = 0 -au BufWritePost *.rmd,*.rnw, silent! :call RWeave("nobib", 1, 1) -au VimLeave *.rmd,*.rnw,*.tex !texclear % " Emmet Expansion let g:user_emmet_leader_key=',' " Enable kite autocompletion @@ -158,12 +149,9 @@ let g:user_emmet_leader_key=',' " MarkdownPreview " let g:mkdp_browser = 'surf' " Bracey -let g:bracey_browser_command = "chromium" +let g:bracey_browser_command = "firefox" " Grammalecte path let g:grammalecte_cli_py = "/usr/bin/grammalecte-cli" -" Ale Linter with prettier -let g:ale_linters_explicit = 1 -" autocmd BufWrite, *.css,*.html,*.js :ALEFix prettier " Ultisnips " Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe. let g:UltiSnipsExpandTrigger="<Tab>" @@ -173,24 +161,8 @@ let g:ale_linters_explicit = 1 let g:UltiSnipsEditSplit="vertical" " Snippet directory let g:UltiSnipsSnippetDirectories=[$HOME.'/.config/nvim/UltiSnips'] -" Go deoplete -let g:deoplete#sources#go#gocode_binary = '$GOPATH/bin/gocode' " Hexokinase let g:Hexokinase_highlighters = ['virtual'] -" GoRun Split Reuse -function! ReuseVimGoTerm(cmd) abort - for w in nvim_list_wins() - if "goterm" == nvim_buf_get_option(nvim_win_get_buf(w), 'filetype') - call nvim_win_close(w, v:true) - break - endif - endfor - execute a:cmd -endfunction -let g:go_term_enabled = 1 -let g:go_term_mode = "silent keepalt rightbelow 35 vsplit" -let g:go_def_reuse_buffer = 1 -autocmd FileType go nmap <leader>r :call ReuseVimGoTerm('GoRun')<Return> " Vimtex pdf viewer let g:vimtex_view_general_viewer = 'open' let g:vimtex_view_general_options = '-a zathura' @@ -237,7 +209,7 @@ command RcTitle .!figlet -s -f big " Easily escape terminal mode tnoremap <Esc> <C-\><C-n> " Pressing shift semicolon was too long: -nnoremap <Space> : +nmap <Space> <Leader> " Fastest :w in the west nnoremap <leader>w :w<CR> " #---Visual Enhancements---# " @@ -250,11 +222,6 @@ let g:lightline = { \ 'colorscheme': 'friffle', \ } set noshowmode -" Vim-go breakpoints and debug -nnoremap mp :GoDebugBreakpoint<CR> -nnoremap mn :GoDebugNext<CR> -nnoremap ms :GoDebugStart<CR> -nnoremap mq :GoDebugStop<CR> " #---Ease Of Use---# " " Normal/relative number toggle @@ -268,18 +235,6 @@ augroup END autocmd BufWritePre * %s/\s\+$//e " Soft Tabs filetype plugin indent on -" NERDTRee Hotkey map -map <C-n> :NERDTreeToggle<CR> - let NERDTreeDirArrowExpandable="|" - let NERDTreeDirArrowCollapsible="-" -" Close vim if the only window left open is a NERDTree -autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif -" Other NERDTree Preferences -let NERDTreeMinimalUI = 1 -let NERDTreeDirArrows = 1 -let NERDTreeShowBookmarks=1 -let NERDTreeAutoDeleteBuffer = 1 -let NERDTreeQuitOnOpen = 1 " Nvim-R send line nmap <C-Enter> <leader>l " Nvim folding |