From 36617c163cccc763e587c3b49d973b65566bf651 Mon Sep 17 00:00:00 2001 From: Maxim Likhachev Date: Mon, 9 Dec 2019 14:00:56 +0300 Subject: [PATCH] vim: --fff.vim --- etc/soft/vim/vim/+plugins/fff.vim/LICENSE.md | 21 ------- etc/soft/vim/vim/+plugins/fff.vim/README.md | 66 ---------------------- etc/soft/vim/vim/+plugins/fff.vim/autoload/fff.vim | 48 ---------------- etc/soft/vim/vim/+plugins/fff.vim/plugin/fff.vim | 8 --- .../vim/vim/+plugins_disabled/fff.vim/LICENSE.md | 21 +++++++ .../vim/vim/+plugins_disabled/fff.vim/README.md | 66 ++++++++++++++++++++++ .../vim/+plugins_disabled/fff.vim/autoload/fff.vim | 48 ++++++++++++++++ .../vim/+plugins_disabled/fff.vim/plugin/fff.vim | 8 +++ 8 files changed, 143 insertions(+), 143 deletions(-) delete mode 100644 etc/soft/vim/vim/+plugins/fff.vim/LICENSE.md delete mode 100644 etc/soft/vim/vim/+plugins/fff.vim/README.md delete mode 100644 etc/soft/vim/vim/+plugins/fff.vim/autoload/fff.vim delete mode 100644 etc/soft/vim/vim/+plugins/fff.vim/plugin/fff.vim create mode 100644 etc/soft/vim/vim/+plugins_disabled/fff.vim/LICENSE.md create mode 100644 etc/soft/vim/vim/+plugins_disabled/fff.vim/README.md create mode 100644 etc/soft/vim/vim/+plugins_disabled/fff.vim/autoload/fff.vim create mode 100644 etc/soft/vim/vim/+plugins_disabled/fff.vim/plugin/fff.vim diff --git a/etc/soft/vim/vim/+plugins/fff.vim/LICENSE.md b/etc/soft/vim/vim/+plugins/fff.vim/LICENSE.md deleted file mode 100644 index 222788b..0000000 --- a/etc/soft/vim/vim/+plugins/fff.vim/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2017 Dylan Araps - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/etc/soft/vim/vim/+plugins/fff.vim/README.md b/etc/soft/vim/vim/+plugins/fff.vim/README.md deleted file mode 100644 index 384f291..0000000 --- a/etc/soft/vim/vim/+plugins/fff.vim/README.md +++ /dev/null @@ -1,66 +0,0 @@ -# fff.vim - -A plugin for vim/neovim which allows you to use [**`fff`**](https://github.com/dylanaraps/fff) as a file opener. - -## Table of Contents - - - -* [Installation](#installation) -* [Usage](#usage) - * [Command](#command) - * [Easy hotkey](#easy-hotkey) -* [Customization](#customization) - * [Split Size](#split-size) - * [Split Direction](#split-direction) - - - -## Installation - -Using [vim-plug](https://github.com/junegunn/vim-plug): - -```vim -Plug 'dylanaraps/fff.vim' -``` - -Then run `:PlugUpdate` - -## Usage - -### Command - -```vim -" Open in current directory. -:F - -" Open in ~/dotfiles (or other path) -:F ~/dotfiles -``` - -### Easy hotkey - -```vim -" Open fff on press of 'f' -nnoremap f :F -``` - -## Customization - -### Split Size - -Default: `let g:fff#split = "10new"` - -```vim -# Vertical split (NERDtree style). -let g:fff#split = "30vnew" -``` - -### Split Direction - -Default: `let g:fff#split_direction = "splitbelow splitright"` - -```vim -# Open split on the left side (NERDtree style). -let g:fff#split_direction = "nosplitbelow nosplitright" -``` diff --git a/etc/soft/vim/vim/+plugins/fff.vim/autoload/fff.vim b/etc/soft/vim/vim/+plugins/fff.vim/autoload/fff.vim deleted file mode 100644 index e4c5772..0000000 --- a/etc/soft/vim/vim/+plugins/fff.vim/autoload/fff.vim +++ /dev/null @@ -1,48 +0,0 @@ -" fff.vim - -let g:fff#split = get(g:, 'fff#split', '10new') -let g:fff#split_direction = get(g:, 'fff#split_direction', - \ 'splitbelow splitright') - -function! fff#open_file(...) - let tmp_file = $XDG_CACHE_HOME - - if !isdirectory(tmp_file) - let tmp_file = $HOME . "/.cache" - endif - - let tmp_file .= "/fff/opened_file" - let tmp_file = fnameescape(tmp_file) - bd! - - if filereadable(tmp_file) - let file_data = readfile(tmp_file) - execute delete(tmp_file) - else - return - endif - - if filereadable(file_data[0]) - execute "e " . file_data[0] - endif -endfunction - -function! fff#Run(command) - execute 'setlocal' . ' ' . g:fff#split_direction - execute g:fff#split - execute 'setlocal nonumber' - execute 'setlocal norelativenumber' - - if has('nvim') - call termopen('fff -p ' . a:command, - \ {'on_exit': function('fff#open_file') }) - startinsert - else - let buffer = term_start([&shell, &shellcmdflag, 'fff -p ' . a:command], - \ {'curwin': 1, 'exit_cb': function('fff#open_file')}) - - if !has('patch-8.0.1261') - call term_wait(buffer, 20) - endif - endif -endfunction diff --git a/etc/soft/vim/vim/+plugins/fff.vim/plugin/fff.vim b/etc/soft/vim/vim/+plugins/fff.vim/plugin/fff.vim deleted file mode 100644 index b0ad8f0..0000000 --- a/etc/soft/vim/vim/+plugins/fff.vim/plugin/fff.vim +++ /dev/null @@ -1,8 +0,0 @@ -" fff.vim - -if exists('g:loaded_fff') - finish -endif -let g:loaded_fff = 1 - -command! -nargs=* -complete=dir F call fff#Run() diff --git a/etc/soft/vim/vim/+plugins_disabled/fff.vim/LICENSE.md b/etc/soft/vim/vim/+plugins_disabled/fff.vim/LICENSE.md new file mode 100644 index 0000000..222788b --- /dev/null +++ b/etc/soft/vim/vim/+plugins_disabled/fff.vim/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Dylan Araps + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/etc/soft/vim/vim/+plugins_disabled/fff.vim/README.md b/etc/soft/vim/vim/+plugins_disabled/fff.vim/README.md new file mode 100644 index 0000000..384f291 --- /dev/null +++ b/etc/soft/vim/vim/+plugins_disabled/fff.vim/README.md @@ -0,0 +1,66 @@ +# fff.vim + +A plugin for vim/neovim which allows you to use [**`fff`**](https://github.com/dylanaraps/fff) as a file opener. + +## Table of Contents + + + +* [Installation](#installation) +* [Usage](#usage) + * [Command](#command) + * [Easy hotkey](#easy-hotkey) +* [Customization](#customization) + * [Split Size](#split-size) + * [Split Direction](#split-direction) + + + +## Installation + +Using [vim-plug](https://github.com/junegunn/vim-plug): + +```vim +Plug 'dylanaraps/fff.vim' +``` + +Then run `:PlugUpdate` + +## Usage + +### Command + +```vim +" Open in current directory. +:F + +" Open in ~/dotfiles (or other path) +:F ~/dotfiles +``` + +### Easy hotkey + +```vim +" Open fff on press of 'f' +nnoremap f :F +``` + +## Customization + +### Split Size + +Default: `let g:fff#split = "10new"` + +```vim +# Vertical split (NERDtree style). +let g:fff#split = "30vnew" +``` + +### Split Direction + +Default: `let g:fff#split_direction = "splitbelow splitright"` + +```vim +# Open split on the left side (NERDtree style). +let g:fff#split_direction = "nosplitbelow nosplitright" +``` diff --git a/etc/soft/vim/vim/+plugins_disabled/fff.vim/autoload/fff.vim b/etc/soft/vim/vim/+plugins_disabled/fff.vim/autoload/fff.vim new file mode 100644 index 0000000..e4c5772 --- /dev/null +++ b/etc/soft/vim/vim/+plugins_disabled/fff.vim/autoload/fff.vim @@ -0,0 +1,48 @@ +" fff.vim + +let g:fff#split = get(g:, 'fff#split', '10new') +let g:fff#split_direction = get(g:, 'fff#split_direction', + \ 'splitbelow splitright') + +function! fff#open_file(...) + let tmp_file = $XDG_CACHE_HOME + + if !isdirectory(tmp_file) + let tmp_file = $HOME . "/.cache" + endif + + let tmp_file .= "/fff/opened_file" + let tmp_file = fnameescape(tmp_file) + bd! + + if filereadable(tmp_file) + let file_data = readfile(tmp_file) + execute delete(tmp_file) + else + return + endif + + if filereadable(file_data[0]) + execute "e " . file_data[0] + endif +endfunction + +function! fff#Run(command) + execute 'setlocal' . ' ' . g:fff#split_direction + execute g:fff#split + execute 'setlocal nonumber' + execute 'setlocal norelativenumber' + + if has('nvim') + call termopen('fff -p ' . a:command, + \ {'on_exit': function('fff#open_file') }) + startinsert + else + let buffer = term_start([&shell, &shellcmdflag, 'fff -p ' . a:command], + \ {'curwin': 1, 'exit_cb': function('fff#open_file')}) + + if !has('patch-8.0.1261') + call term_wait(buffer, 20) + endif + endif +endfunction diff --git a/etc/soft/vim/vim/+plugins_disabled/fff.vim/plugin/fff.vim b/etc/soft/vim/vim/+plugins_disabled/fff.vim/plugin/fff.vim new file mode 100644 index 0000000..b0ad8f0 --- /dev/null +++ b/etc/soft/vim/vim/+plugins_disabled/fff.vim/plugin/fff.vim @@ -0,0 +1,8 @@ +" fff.vim + +if exists('g:loaded_fff') + finish +endif +let g:loaded_fff = 1 + +command! -nargs=* -complete=dir F call fff#Run()