Skip to content

Commit

Permalink
Fix editorconfig for markdown, improve tab compl
Browse files Browse the repository at this point in the history
Signed-off-by: Tomas Slusny <[email protected]>
  • Loading branch information
deathbeam committed Apr 10, 2017
1 parent 335783f commit c6723a0
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 23 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
indent_size = 8
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,17 @@ To add your own Vim, Tmux or Zsh plugin you can just clone it to proper
* [base-16-shell](https://github.com/chriskempson/base16-shell): A shell script
to change your shell's default ANSI colors but most importantly, colors 17 to
21 of your shell's 256 colorspace (if supported by your terminal)
* [cdls](https://github.com/deathbeam/dotfiles/tree/master/zsh/.zsh/bundle/cdls.plugin.zsh):
* [__cdls__*](https://github.com/deathbeam/dotfiles/tree/master/zsh/.zsh/bundle/cdls.plugin.zsh):
Runs `ls -A` on directory change
* [codi](https://github.com/deathbeam/dotfiles/tree/master/zsh/.zsh/bundle/codi.plugin.zsh):
* [__codi__*](https://github.com/deathbeam/dotfiles/tree/master/zsh/.zsh/bundle/codi.plugin.zsh):
A nice way to use Codi is through a shell wrapper
* [fzf](https://github.com/junegunn/fzf): A command-line fuzzy finder written
in Go
* [globalias](https://github.com/deathbeam/dotfiles/tree/master/zsh/.zsh/bundle/globalias.plugin.zsh):
* [__globalias__**](https://github.com/deathbeam/dotfiles/tree/master/zsh/.zsh/bundle/globalias.plugin.zsh):
Expands all glob expressions, subcommands and aliases (including global)
* [ix](https://github.com/deathbeam/dotfiles/tree/master/zsh/.zsh/bundle/ix.plugin.zsh):
* [__ix__*](https://github.com/deathbeam/dotfiles/tree/master/zsh/.zsh/bundle/ix.plugin.zsh):
A command line pastebin - shell
* [vi-mode](https://github.com/deathbeam/dotfiles/tree/master/zsh/.zsh/bundle/vi-mode.plugin.zsh):
* [__vi-mode__**](https://github.com/deathbeam/dotfiles/tree/master/zsh/.zsh/bundle/vi-mode.plugin.zsh):
Enhanced Vi mode for zsh with history substring search support
* [zim](https://github.com/Eriner/zim): ZIM - Zsh IMproved

Expand All @@ -94,7 +94,7 @@ To add your own Vim, Tmux or Zsh plugin you can just clone it to proper
* [editorconfig-vim](https://github.com/editorconfig/editorconfig-vim):
EditorConfig plugin for Vim
* [fzf.vim](https://github.com/junegunn/fzf.vim): fzf :heart: vim
* [fzf-contrib](https://github.com/deathbeam/dotfiles/tree/master/vim/.vim/bundle/fzf-contrib):
* [__fzf-contrib__*](https://github.com/deathbeam/dotfiles/tree/master/vim/.vim/bundle/fzf-contrib):
Completion menu using FZF, tab-completion, support for `ripgrep` in FZF
* [syntastic](https://github.com/scrooloose/syntastic): Syntax checking hacks
for vim
Expand Down Expand Up @@ -155,3 +155,6 @@ To add your own Vim, Tmux or Zsh plugin you can just clone it to proper
system clipboard
* [vim-tmux-navigator](https://github.com/christoomey/vim-tmux-navigator):
Seamless navigation between tmux panes and vim splits

__*__ _These plugins are made by me, so do not bother searching for them online_
__**__ _These plugins are copied from oh-my-zsh, with some modifications_
3 changes: 3 additions & 0 deletions editorconfig/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
indent_size = 8
27 changes: 12 additions & 15 deletions vim/.vim/bundle/fzf-contrib/autoload/fzf/contrib.vim
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function! fzf#contrib#complete(findstart, base)
function! fzf#contrib#completefunc(findstart, base) abort
let Func = function(get(g:, 'fzf#contrib#completefunc', &omnifunc))
let results = Func(a:findstart, a:base)
echom a:base
Expand All @@ -20,30 +20,27 @@ function! fzf#contrib#complete(findstart, base)
if exists('*UltiSnips#ExpandSnippet')
\ && len(results) == 1
\ && len(results[0]) > 1
\ && match(split(results[0], "\t")[1], '\[snip\]') != -1
\ && split(results[0], "\t")[1] =~? '\[snip\]'
call feedkeys("\<c-r>=UltiSnips#ExpandSnippet()\<cr>")
endif

return map(results, 'split(v:val, "\t")[0]')
endfunction

function! fzf#contrib#trigger_complete()
setlocal completefunc=fzf#contrib#complete
function! fzf#contrib#complete(...) abort
if len(a:000) && a:000[0]
if getline('.')[col('.') - 1] !~# '\S'
call feedkeys("\<tab>", 'n')
return
endif
endif

setlocal completefunc=fzf#contrib#completefunc
setlocal completeopt=menu
call feedkeys("\<c-x>\<c-u>", 'n')
endfunction

function! fzf#contrib#tab_complete()
let col = col('.') - 1

if !col || getline('.')[col - 1] !~# '\k'
call feedkeys("\<tab>", 'n')
else
call fzf#contrib#trigger_complete()
endif
endfunction

function! fzf#contrib#grep(query, ...)
function! fzf#contrib#grep(query, ...) abort
if executable('rg')
let query = empty(a:query) ? '^.' : a:query
let args = copy(a:000)
Expand Down
4 changes: 2 additions & 2 deletions vim/.vim/bundle/fzf-contrib/plugin/fzf-contrib.vim
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
imap <c-x><c-j> <c-o>:call fzf#contrib#trigger_complete()<cr>
inoremap <silent> <tab> <c-o>:call fzf#contrib#tab_complete()<cr>
inoremap <silent> <c-x><c-j> <c-o>:call fzf#contrib#complete()<cr>
inoremap <silent> <tab> <c-o>:call fzf#contrib#complete(1)<cr>
command! -bang -nargs=* Grep call fzf#contrib#grep(<q-args>, <bang>0)
2 changes: 2 additions & 0 deletions zsh/.zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@ while read filename; do source "$filename"; done
# Use faster FZF grep command if possible
if command -v rg >/dev/null 2>&1; then
export FZF_DEFAULT_COMMAND='rg --files --hidden --follow --glob "!.git/*"'
export FZF_CTRL_T_COMMAND=$FZF_DEFAULT_COMMAND
elif command -v ag >/dev/null 2>&1; then
export FZF_DEFAULT_COMMAND='ag -g ""'
export FZF_CTRL_T_COMMAND=$FZF_DEFAULT_COMMAND
fi

# Load base16 theme
Expand Down

0 comments on commit c6723a0

Please sign in to comment.