1
0

4 Коммитууд 9dc3fdd4d0 ... a303803c95

Эзэн SHA1 Мессеж Огноо
  Frans Bergman a303803c95 [install.sh] Remove Oh-My-Zsh installation steps 1 жил өмнө
  Frans Bergman c1fdca93dc [init.vim] Use the rust-analyzer linter for ALE 2 жил өмнө
  Frans Bergman dbe352befb [init.vim]: Remove never-used 'ret' abbreviation 2 жил өмнө
  Frans Bergman fcf9a77ffb [init.vim]: Do not disable hlsearch on <esc> 2 жил өмнө
2 өөрчлөгдсөн 24 нэмэгдсэн , 60 устгасан
  1. 24 51
      .config/nvim/init.vim
  2. 0 9
      install.sh

+ 24 - 51
.config/nvim/init.vim

@@ -53,8 +53,6 @@ noremap <leader>p :!opout <c-r>%<CR><CR>
 
 nnoremap <leader>u :!ctags -R .<CR>
 
-nnoremap <esc> :set nohlsearch<CR>
-
 " Local (scope) replace
 nnoremap gr gd[{V%::s/<C-R>///gc<left><left><left>
 
@@ -93,7 +91,6 @@ let g:DVB_TrimWS = 1
 " }}}
 
 " ########## Abbreviations ########## {{{
-iabbrev ret return
 iabbrev @@ frans@tankernn.eu
 iabbrev ssig -- <cr>Frans Bergman<cr>frans@tankernn.eu
 " }}}
@@ -104,6 +101,30 @@ autocmd FileType vim :set foldmethod=marker
 autocmd BufNewFile,BufRead *.ms,*.me,*.mom,*.man set filetype=groff
 " }}}
 
+" ########## Plugin Settings ########## {{{
+let g:ale_linters = {'rust': ['analyzer']}
+set omnifunc=ale#completion#OmniFunc
+let g:ale_completion_enabled = 1
+let g:ale_completion_autoimport = 1
+let g:ale_fix_on_save = 1
+let g:ale_fixers = {
+    \ '*': ['remove_trailing_lines', 'trim_whitespace'],
+    \ 'rust': ['rustfmt'],
+\}
+
+nmap <leader>an <Plug>(ale_next)
+nmap <leader>ap <Plug>(ale_previous)
+
+augroup rust
+    autocmd!
+    autocmd FileType rust let b:delimitMate_smart_quotes='\%(\w\|[^[:punct:][:space:]]\|\%(\\\\\)*\\\)\%#\|\%#\%(\w\|[^[:space:][:punct:]]\)\|\<\%#\|\&\%#'
+augroup END
+
+" Use `tab` key to select completions.  Default is arrow keys.
+inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
+inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
+" }}}
+
 " ########## Plugins ########## {{{
 call plug#begin()
 Plug 'tpope/vim-fugitive'
@@ -115,58 +136,10 @@ Plug 'tpope/vim-repeat'
 Plug 'raimondi/delimitmate'
 Plug 'fisadev/dragvisuals.vim'
 Plug 'dense-analysis/ale'
-Plug 'maralla/completor.vim'
 Plug 'junegunn/fzf'
-Plug 'Chiel92/vim-autoformat'
 Plug 'preservim/nerdtree'
 Plug 'vim-scripts/taglist.vim'
 Plug 'ashinkarov/nvim-agda'
 Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
 call plug#end()
 " }}}
-
-" ########## Plugin Settings ########## {{{
-let g:ale_linters = {'rust': ['cargo', 'rls']}
-let g:deoplete#enable_at_startup = 1
-
-nmap <leader>an <Plug>(ale_next)
-nmap <leader>ap <Plug>(ale_previous)
-
-let g:completor_filetype_map = {}
-" Enable lsp for rust by using rls
-let g:completor_filetype_map.rust = {'ft': 'lsp', 'cmd': 'rls'}
-
-augroup rust
-    autocmd!
-    autocmd FileType rust au BufWrite <buffer> :Autoformat
-    autocmd FileType rust let b:delimitMate_smart_quotes='\%(\w\|[^[:punct:][:space:]]\|\%(\\\\\)*\\\)\%#\|\%#\%(\w\|[^[:space:][:punct:]]\)\|\<\%#\|\&\%#'
-augroup END
-
-" Use TAB to complete when typing words, else inserts TABs as usual.  Uses
-" dictionary, source files, and completor to find matching words to complete.
-
-" Note: usual completion is on <C-n> but more trouble to press all the time.
-" Never type the same word twice and maybe learn a new spellings!
-" Use the Linux dictionary when spelling is in doubt.
-function! Tab_Or_Complete() abort
-    " If completor is already open the `tab` cycles through suggested completions.
-    if pumvisible()
-        return "\<C-N>"
-        " If completor is not open and we are in the middle of typing a word then
-        " `tab` opens completor menu.
-    elseif col('.')>1 && strpart( getline('.'), col('.')-2, 3 ) =~ '^[[:keyword:][:ident:]]'
-        return "\<C-R>=completor#do('complete')\<CR>"
-    else
-        " If we aren't typing a word and we press `tab` simply do the normal `tab`
-        " action.
-        return "\<Tab>"
-    endif
-endfunction
-
-" Use `tab` key to select completions.  Default is arrow keys.
-inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
-inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
-
-" Use tab to trigger auto completion.
-inoremap <expr> <Tab> Tab_Or_Complete()
-" }}}

+ 0 - 9
install.sh

@@ -41,15 +41,6 @@ git_make_install()
     )
 }
 
-fancy_print "Installing Oh My Zsh"
-sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
-# Replace default Oh My Zsh config
-ln -sf "$(realpath .zshrc)" ~
-
-fancy_print "Installing Oh My Zsh plugins"
-git clone https://github.com/zsh-users/zsh-autosuggestions "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions"
-git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting"
-
 fancy_print "Installing fzf"
 git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
 ~/.fzf/install --key-bindings --completion --no-update-rc