This commit is contained in:
doyle 2021-09-15 13:19:25 +10:00
parent a3ad610cb6
commit f6c65c7c03
3 changed files with 69 additions and 25 deletions

View File

@ -15,7 +15,8 @@ Plug 'https://github.com/scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'https://github.com/tpope/vim-fugitive'
Plug 'https://github.com/bfrg/vim-cpp-modern'
Plug 'https://github.com/skywind3000/asyncrun.vim'
Plug 'https://github.com/Yggdroot/LeaderF'
Plug 'https://github.com/junegunn/fzf'
Plug 'https://github.com/junegunn/fzf.vim'
" Themes
Plug 'https://github.com/tomasr/molokai'
@ -190,34 +191,20 @@ if s:running_windows
endif
" ==============================================================================
" Leaderf
" FZF
" ==============================================================================
" Config
let g:Lf_MruFileExclude = ['tags', '*.so', '.o', '*.exe', '*.dll']
let g:Lf_UseVersionControlTool = 0
let g:Lf_JumpToExistingWindow = 0
let g:Lf_WildIgnore = {
\ 'dir': ['.git', '.svn', '.hg'],
\ 'file': ['tags', '*.so', '.o', '*.exe', '*.dll']
\}
nnoremap <leader>f :FzfFiles<CR>
nnoremap <leader>t :FzfTags<CR>
nnoremap <leader>r :FzfRg<CR>
let g:Lf_CtagsFuncOpts = {
\ 'c': '--c-kinds=fp',
\ 'c++': '--c++-kinds=+p --fields=+iaS --extra=+q --language-force=C++',
\ 'rust': '--rust-kinds=f',
\ }
" Empty value to disable preview window altogether
let g:fzf_preview_window = []
" Bindings
nnoremap <leader>b :<C-U><C-R>=printf("Leaderf buffer %s", "")<CR><CR>
nnoremap <leader>f :<C-U><C-R>=printf("Leaderf file %s", "")<CR><CR>
nnoremap <leader>l :<C-U><C-R>=printf("Leaderf line %s", "")<CR><CR>
nnoremap <leader>m :<C-U><C-R>=printf("Leaderf mru %s", "")<CR><CR>
nnoremap <leader>p :<C-U><C-R>=printf("Leaderf function %s", "")<CR><CR>
nnoremap <leader>t :<C-U><C-R>=printf("Leaderf tag %s", "")<CR><CR>
nnoremap <leader>h :<C-U><C-R>=printf("Leaderf self %s", "")<CR><CR>
" Prefix all commands with Fzf for discoverability
let g:fzf_command_prefix = 'Fzf'
noremap <C-P> :<C-U><C-R>=printf("Leaderf bufTag %s", "")<CR><CR>
noremap <C-F> :<C-U><C-R>=printf("Leaderf! rg -e %s ", expand("<cword>"))<CR>
" - down / up / left / right
let g:fzf_layout = { 'down': '40%' }
" ==============================================================================
" Clang Format

View File

@ -161,6 +161,43 @@ if !install_everything_void_tools! == 1 (
call :VerifyFileSHA256 "!everything_exe!" "!everything_exe_sha256!" || exit /B
)
REM ----------------------------------------------------------------------------
REM fzf
REM ----------------------------------------------------------------------------
if !install_fzf! == 1 (
set fzf_sha256=c9b5c8bdbef06305a2d0a33b0d82218bebd5a81a3f2187624d4a9d8fe972fc09
set fzf_exe_sha256=83cdcb08d65edc734205f9de5e87ef3261358a4abf6f21e1c97d431205da8bc9
set fzf_version=0.27.2
set fzf_zip=!downloads_dir!\win32_fzf_v!fzf_version!.zip
set fzf_dir=!cmder_dir!\bin
set fzf_exe=!fzf_dir!\fzf.exe
if not exist "!fzf_exe!" (
call :DownloadFile "https://github.com/junegunn/fzf/releases/download/!fzf_version!/fzf-!fzf_version!-windows_amd64.zip" "!fzf_zip!" || exit /B
call :VerifyFileSHA256 "!fzf_zip!" "!fzf_sha256!" || exit /B
call :UnzipAndAlwaysOverwrite "!fzf_zip!" "!fzf_dir!" || exit /B
)
REM Windows integration tool
set ff_sha256=244e5f67b4fe7239b775af16586d5af7a5d59334ae00f7ead31bba1b91c1e51b
set ff_exe_sha256=244e5f67b4fe7239b775af16586d5af7a5d59334ae00f7ead31bba1b91c1e51b
set ff_version=0.1.1
set ff_zip=!downloads_dir!\win32_ff_v!ff_version!.zip
set ff_dir=!cmder_dir!\bin
set ff_exe=!ff_dir!\ff.exe
if not exist "!ff_exe!" (
call :DownloadFile "https://github.com/genotrance/ff/releases/download/v!ff_version!/ff-v!ff_version!.zip" "!ff_zip!" || exit /B
call :VerifyFileSHA256 "!ff_zip!" "!ff_sha256!" || exit /B
call :UnzipAndAlwaysOverwrite "!ff_zip!" "!ff_dir!" || exit /B
)
call :VerifyFileSHA256 "!fzf_exe!" "!fzf_exe_sha256!" || exit /B
call :VerifyFileSHA256 "!ff_exe!" "!ff_exe_sha256!" || exit /B
)
REM ----------------------------------------------------------------------------
REM GVim, Vim Plug, Vim Config
REM ----------------------------------------------------------------------------
@ -534,6 +571,15 @@ echo set USERPROFILE=%%~dp0!home_dir!>> "!terminal_script!"
echo set PATH=%%~dp0!gpg_w32_bin_dir!;%%PATH%%>> "!terminal_script!"
if !install_fzf! == 1 (
echo set FZF_DEFAULT_OPTS=--multi --layout=reverse>> "!terminal_script!"
REM Use RG for FZF to make it ultra fast
if !install_ripgrep! == 1 (
echo set FZF_DEFAULT_COMMAND=rg --files --no-ignore-vcs --hidden>> "!terminal_script!"
)
)
if !install_gvim! == 1 ( echo set PATH=%%~dp0!gvim_dir!;%%PATH%%>> "!terminal_script!" )
if !install_llvm_clang! == 1 ( echo set PATH=%%~dp0!llvm_bin_dir!;%%PATH%%>> "!terminal_script!" )
if !install_mingw64! == 1 ( echo set PATH=%%~dp0!mingw_bin_dir!;%%PATH%%>> "!terminal_script!" )
@ -619,6 +665,16 @@ if exist !dest! (
)
exit /B !ERROLEVEL!
REM ------------------------------------------------------------------------------------------------
:UnzipAndAlwaysOverwrite
set zip_file=%~1
set dest=%~2
set msg=[Unzip] !zip_file! to !dest!
echo - !msg!
call !zip7_dir!\7z.exe x -y -spe -o!dest! !zip_file!
exit /B !ERROLEVEL!
REM ------------------------------------------------------------------------------------------------
:VerifyFileSHA256
set file=%~1

View File

@ -20,6 +20,7 @@ REM QoL/Tools
REM ----------------------------------------------------------------------------
set install_dependency_walker=1
set install_everything_void_tools=1
set install_fzf=1
set install_gvim=1
set install_joplin=1
set install_keypirinha=1