Skip to content

Commit

Permalink
zk: only activate on prefix, vim: switch to rust-analyzer, clone: tol…
Browse files Browse the repository at this point in the history
…erate suffix
  • Loading branch information
sirupsen committed Apr 28, 2020
1 parent 2a60efd commit 3cff68d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion home/.bin/clone
@@ -1,7 +1,7 @@
#!/usr/bin/env ruby
# Paste an ugly URL from Github anywhere and launch a Tmux Window with a Vim session in it.

GITHUB_REPO_REGEX = /https:\/\/github.com\/(?<org>[\w\._-]+)\/(?<project>[\w\._-]+)/
GITHUB_REPO_REGEX = /https:\/\/github.com\/(?<org>[\w\._-]+)\/(?<project>[\w_-]+)/
SLASH_REGEX = /(?<org>[\w\._-]+)\/(?<project>[\w\._-]+)/
FILE_REGEX = /\/blob\/(?<sha>\w+)\/(?<path>[\w\/\.-_]+)(#L?)?(?<line>\d+)?/

Expand Down
14 changes: 10 additions & 4 deletions home/.vimrc
Expand Up @@ -228,7 +228,13 @@ let g:ale_set_balloons = 1
" new files.
let g:ale_linters_explicit = 1

let g:ale_rust_rls_toolchain = 'stable'
" let g:ale_rust_rls_toolchain = 'stable'
let g:ale_rust_rls_executable = 'rust-analyzer'
let g:ale_rust_rls_config = {
\ 'rust': {
\ 'clippy_preference': 'on'
\ }
\ }

let g:ale_set_highlights = 0 " signs are enough
let g:ale_cursor_detail = 0
Expand Down Expand Up @@ -470,6 +476,9 @@ endfunction
command! -nargs=* Note call Note(<f-args>)

function! ZettelkastenSetup()
if expand("%:t") !~ '^[0-9]\+'
return
endif
" syn region mkdFootnotes matchgroup=mkdDelimiter start="\[\[" end="\]\]"

inoremap <expr> <plug>(fzf-complete-path-custom) fzf#vim#complete#path("rg --files -t md \| sed 's/^/[[/g' \| sed 's/$/]]/'")
Expand All @@ -489,9 +498,6 @@ function! ZettelkastenSetup()
\ 'reducer': function('<sid>CompleteTagsReducer')
\ }))
imap <buffer> # <plug>(fzf-complete-tags)
" setlocal formatoptions+=a
" imap <imap> -- —
endfunction

" Don't know why I can't get FZF to return {2}
Expand Down

0 comments on commit 3cff68d

Please sign in to comment.