Change the Java unused imports behavior to use a Vim plugin installed in setup.sh.

This commit is contained in:
Jonathan Bernard 2017-06-28 14:05:43 -05:00
parent 387ea604f4
commit a5ba51f77e
2 changed files with 3 additions and 4 deletions

6
.vimrc
View File

@ -71,10 +71,8 @@ let groovy_allow_cpp_keywords = 1
" nmap <Leader>gs wve"tywve"py'bo public void set "ppbvUhxA("tpA "ppA) { this."ppA = "ppA; } public "tpA get "ppbvUhxA() { return this."ppA; }mb'a/private \w+\+ \w\+; ma
nmap <Leader>jgs :let @t=''<CR>:let @n=''<CR>'a0v$:s/\v^\s*(private\|public\|protected)? ?(\w+(\<[^>]+\>)?) (\w+);/\=setreg('T', submatch(2))/n<CR>0v$:s/\v^\s*(private\|public\|protected)? ?(\w+(\<[^>]+\>)?) (\w+);/\=setreg('N', submatch(4))/n<CR>'bo<CR>public <ESC>"tpA get <ESC>"npbvUhxA() {<CR> return this.<ESC>"npA;<CR>}<ESC><<o<CR>public void set <ESC>"npbvUhxA(<ESC>"tpA <ESC>"npA) {<CR> this.<ESC>"npA = <ESC>"npA;<CR>}<ESC><<mb'anma
" Clean un-used Java imports. Requires clean_imports.sh executable in the PATH.
" clean_imports.sh should be a filter that reads in a filepath as the first
" argument and prints our the altered file contents on STDOUT.
nmap <Leader>jci :w<CR>:%!clean_imports.sh %<CR>
" Clean un-used Java imports.
nmap <Leader>jci :UnusedImportsRemove<CR>
" Format the file using java-file-formatter. java-file-formatter should be a
" command that takes a file path as the first argument and either alters the

View File

@ -20,6 +20,7 @@ git clone https://github.com/zah/nim.vim.git
git clone https://github.com/tpope/vim-fugitive.git
git clone https://github.com/isRuslan/vim-es6.git
git clone https://github.com/airblade/vim-gitgutter.git
git clone https://github.com:akhaku/vim-java-unused-imports.git
ln -s /usr/share/lilypond/2.18.2/vim lilypond.vim
# Setup ST