Compare commits
5 Commits
cf230f8463
...
771f79cde4
Author | SHA1 | Date | |
---|---|---|---|
771f79cde4 | |||
edc3ccce17 | |||
cedb3a802a | |||
6c8524d0e7 | |||
b356636de7 |
@ -184,7 +184,7 @@ bell:
|
||||
duration: 0
|
||||
|
||||
# Background opacity
|
||||
background_opacity: 1.0
|
||||
# background_opacity: 1.0
|
||||
|
||||
# Mouse bindings
|
||||
#
|
||||
|
37
nvim/.config/nvim/UltiSnips/crystal.snippets
Normal file
37
nvim/.config/nvim/UltiSnips/crystal.snippets
Normal file
@ -0,0 +1,37 @@
|
||||
snippet md "map with do" w
|
||||
map do |${1:e}|
|
||||
$2
|
||||
end
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet m{ "map with {" w
|
||||
map({ |${1:e}| $2 })
|
||||
endsnippet
|
||||
|
||||
snippet ed "each with do" w
|
||||
each do |${1:e}|
|
||||
$2
|
||||
end
|
||||
$0
|
||||
endsnippet
|
||||
|
||||
snippet e{ "each with {" w
|
||||
each({ |${1:e}| $2 })
|
||||
endsnippet
|
||||
|
||||
snippet b "apply block" w
|
||||
${1:min_by}({|${2:e}| $3 })
|
||||
endsnippet
|
||||
|
||||
snippet set "create set" w
|
||||
Set(${1:Int32}).new
|
||||
endsnippet
|
||||
|
||||
snippet ha "create hash" w
|
||||
Hash($1).new
|
||||
endsnippet
|
||||
|
||||
snippet in "includes?" w
|
||||
includes?($1)
|
||||
endsnippet
|
@ -22,6 +22,12 @@ snippet ssec
|
||||
\subsection*{$1}
|
||||
endsnippet
|
||||
|
||||
snippet ol
|
||||
\begin{itemize}
|
||||
$1
|
||||
\end{itemize}
|
||||
endsnippet
|
||||
|
||||
snippet alist
|
||||
\begin{enumerate}[label=\alph*)]
|
||||
$1
|
||||
@ -47,3 +53,17 @@ endsnippet
|
||||
snippet e
|
||||
\epsilon
|
||||
endsnippet
|
||||
|
||||
snippet hs
|
||||
\begin{lstlisting}[language=Haskell]
|
||||
$1
|
||||
\end{lstlisting}
|
||||
endsnippet
|
||||
|
||||
snippet ns
|
||||
\needscite{}
|
||||
endsnippet
|
||||
|
||||
snippet todo
|
||||
\TODO{$1}
|
||||
endsnippet
|
||||
|
@ -116,6 +116,10 @@ let s:TYPE = {
|
||||
let s:loaded = get(s:, 'loaded', {})
|
||||
let s:triggers = get(s:, 'triggers', {})
|
||||
|
||||
function! s:is_powershell(shell)
|
||||
return a:shell =~# 'powershell\(\.exe\)\?$' || a:shell =~# 'pwsh\(\.exe\)\?$'
|
||||
endfunction
|
||||
|
||||
function! s:isabsolute(dir) abort
|
||||
return a:dir =~# '^/' || (has('win32') && a:dir =~? '^\%(\\\|[A-Z]:\)')
|
||||
endfunction
|
||||
@ -238,6 +242,8 @@ function! plug#begin(...)
|
||||
let home = s:path(s:plug_fnamemodify(s:plug_expand(a:1), ':p'))
|
||||
elseif exists('g:plug_home')
|
||||
let home = s:path(g:plug_home)
|
||||
elseif has('nvim')
|
||||
let home = stdpath('data') . '/plugged'
|
||||
elseif !empty(&rtp)
|
||||
let home = s:path(split(&rtp, ',')[0]) . '/plugged'
|
||||
else
|
||||
@ -263,7 +269,7 @@ function! s:define_commands()
|
||||
endif
|
||||
if has('win32')
|
||||
\ && &shellslash
|
||||
\ && (&shell =~# 'cmd\(\.exe\)\?$' || &shell =~# 'powershell\(\.exe\)\?$')
|
||||
\ && (&shell =~# 'cmd\(\.exe\)\?$' || s:is_powershell(&shell))
|
||||
return s:err('vim-plug does not support shell, ' . &shell . ', when shellslash is set.')
|
||||
endif
|
||||
if !has('nvim')
|
||||
@ -346,7 +352,7 @@ function! plug#end()
|
||||
endif
|
||||
let lod = { 'ft': {}, 'map': {}, 'cmd': {} }
|
||||
|
||||
if exists('g:did_load_filetypes')
|
||||
if get(g:, 'did_load_filetypes', 0)
|
||||
filetype off
|
||||
endif
|
||||
for name in g:plugs_order
|
||||
@ -401,7 +407,7 @@ function! plug#end()
|
||||
|
||||
for [map, names] in items(lod.map)
|
||||
for [mode, map_prefix, key_prefix] in
|
||||
\ [['i', '<C-O>', ''], ['n', '', ''], ['v', '', 'gv'], ['o', '', '']]
|
||||
\ [['i', '<C-\><C-O>', ''], ['n', '', ''], ['v', '', 'gv'], ['o', '', '']]
|
||||
execute printf(
|
||||
\ '%snoremap <silent> %s %s:<C-U>call <SID>lod_map(%s, %s, %s, "%s")<CR>',
|
||||
\ mode, map, map_prefix, string(map), string(names), mode != 'i', key_prefix)
|
||||
@ -503,7 +509,7 @@ if s:is_win
|
||||
let batchfile = s:plug_tempname().'.bat'
|
||||
call writefile(s:wrap_cmds(a:cmd), batchfile)
|
||||
let cmd = plug#shellescape(batchfile, {'shell': &shell, 'script': 0})
|
||||
if &shell =~# 'powershell\(\.exe\)\?$'
|
||||
if s:is_powershell(&shell)
|
||||
let cmd = '& ' . cmd
|
||||
endif
|
||||
return [batchfile, cmd]
|
||||
@ -935,7 +941,7 @@ function! s:prepare(...)
|
||||
call s:new_window()
|
||||
endif
|
||||
|
||||
nnoremap <silent> <buffer> q :if b:plug_preview==1<bar>pc<bar>endif<bar>bd<cr>
|
||||
nnoremap <silent> <buffer> q :call <SID>close_pane()<cr>
|
||||
if a:0 == 0
|
||||
call s:finish_bindings()
|
||||
endif
|
||||
@ -957,6 +963,15 @@ function! s:prepare(...)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:close_pane()
|
||||
if b:plug_preview == 1
|
||||
pc
|
||||
let b:plug_preview = -1
|
||||
else
|
||||
bd
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:assign_name()
|
||||
" Assign buffer name
|
||||
let prefix = '[Plugins]'
|
||||
@ -975,7 +990,7 @@ function! s:chsh(swap)
|
||||
set shell=sh
|
||||
endif
|
||||
if a:swap
|
||||
if &shell =~# 'powershell\(\.exe\)\?$' || &shell =~# 'pwsh$'
|
||||
if s:is_powershell(&shell)
|
||||
let &shellredir = '2>&1 | Out-File -Encoding UTF8 %s'
|
||||
elseif &shell =~# 'sh' || &shell =~# 'cmd\(\.exe\)\?$'
|
||||
set shellredir=>%s\ 2>&1
|
||||
@ -1195,7 +1210,8 @@ function! s:update_impl(pull, force, args) abort
|
||||
normal! 2G
|
||||
silent! redraw
|
||||
|
||||
let s:clone_opt = []
|
||||
" Set remote name, overriding a possible user git config's clone.defaultRemoteName
|
||||
let s:clone_opt = ['--origin', 'origin']
|
||||
if get(g:, 'plug_shallow', 1)
|
||||
call extend(s:clone_opt, ['--depth', '1'])
|
||||
if s:git_version_requirement(1, 7, 10)
|
||||
@ -2216,7 +2232,7 @@ function! plug#shellescape(arg, ...)
|
||||
let script = get(opts, 'script', 1)
|
||||
if shell =~# 'cmd\(\.exe\)\?$'
|
||||
return s:shellesc_cmd(a:arg, script)
|
||||
elseif shell =~# 'powershell\(\.exe\)\?$' || shell =~# 'pwsh$'
|
||||
elseif s:is_powershell(shell)
|
||||
return s:shellesc_ps1(a:arg)
|
||||
endif
|
||||
return s:shellesc_sh(a:arg)
|
||||
@ -2268,7 +2284,7 @@ function! s:system(cmd, ...)
|
||||
return system(a:cmd)
|
||||
endif
|
||||
let cmd = join(map(copy(a:cmd), 'plug#shellescape(v:val, {"shell": &shell, "script": 0})'))
|
||||
if &shell =~# 'powershell\(\.exe\)\?$'
|
||||
if s:is_powershell(&shell)
|
||||
let cmd = '& ' . cmd
|
||||
endif
|
||||
else
|
||||
@ -2605,26 +2621,34 @@ function! s:preview_commit()
|
||||
|
||||
let sha = matchstr(getline('.'), '^ \X*\zs[0-9a-f]\{7,9}')
|
||||
if empty(sha)
|
||||
let name = matchstr(getline('.'), '^- \zs[^:]*\ze:$')
|
||||
if empty(name)
|
||||
return
|
||||
endif
|
||||
|
||||
let title = 'HEAD@{1}..'
|
||||
let command = 'git diff --no-color HEAD@{1}'
|
||||
else
|
||||
let title = sha
|
||||
let command = 'git show --no-color --pretty=medium '.sha
|
||||
let name = s:find_name(line('.'))
|
||||
endif
|
||||
|
||||
if empty(name) || !has_key(g:plugs, name) || !isdirectory(g:plugs[name].dir)
|
||||
return
|
||||
endif
|
||||
|
||||
if exists('g:plug_pwindow') && !s:is_preview_window_open()
|
||||
execute g:plug_pwindow
|
||||
execute 'e' sha
|
||||
execute 'e' title
|
||||
else
|
||||
execute 'pedit' sha
|
||||
execute 'pedit' title
|
||||
wincmd P
|
||||
endif
|
||||
setlocal previewwindow filetype=git buftype=nofile nobuflisted modifiable
|
||||
setlocal previewwindow filetype=git buftype=nofile bufhidden=wipe nobuflisted modifiable
|
||||
let batchfile = ''
|
||||
try
|
||||
let [sh, shellcmdflag, shrd] = s:chsh(1)
|
||||
let cmd = 'cd '.plug#shellescape(g:plugs[name].dir).' && git show --no-color --pretty=medium '.sha
|
||||
let cmd = 'cd '.plug#shellescape(g:plugs[name].dir).' && '.command
|
||||
if s:is_win
|
||||
let [batchfile, cmd] = s:batchfile(cmd)
|
||||
endif
|
||||
@ -2750,9 +2774,9 @@ function! s:snapshot(force, ...) abort
|
||||
1
|
||||
let anchor = line('$') - 3
|
||||
let names = sort(keys(filter(copy(g:plugs),
|
||||
\'has_key(v:val, "uri") && !has_key(v:val, "commit") && isdirectory(v:val.dir)')))
|
||||
\'has_key(v:val, "uri") && isdirectory(v:val.dir)')))
|
||||
for name in reverse(names)
|
||||
let sha = s:git_revision(g:plugs[name].dir)
|
||||
let sha = has_key(g:plugs[name], 'commit') ? g:plugs[name].commit : s:git_revision(g:plugs[name].dir)
|
||||
if !empty(sha)
|
||||
call append(anchor, printf("silent! let g:plugs['%s'].commit = '%s'", name, sha))
|
||||
redraw
|
||||
|
@ -1,8 +1,7 @@
|
||||
call plug#begin('~/.config/nvim/plugged')
|
||||
" Language Tools
|
||||
Plug 'roxma/nvim-yarp' " For language client
|
||||
Plug 'ncm2/ncm2' " For language client
|
||||
Plug 'autozimu/LanguageClient-neovim', {'branch': '0.1.159', 'do': 'bash install.sh' }
|
||||
Plug 'hrsh7th/nvim-compe'
|
||||
Plug 'neovim/nvim-lspconfig'
|
||||
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --bin' }
|
||||
Plug 'junegunn/fzf.vim'
|
||||
Plug 'SirVer/ultisnips'
|
||||
@ -10,6 +9,7 @@ Plug 'luochen1990/rainbow'
|
||||
" Plug 'enomsg/vim-haskellConcealPlus' " This one isn't always good.
|
||||
|
||||
" Languages
|
||||
Plug 'evanleck/vim-svelte'
|
||||
Plug 'LnL7/vim-nix'
|
||||
Plug 'whonore/Coqtail'
|
||||
Plug 'wlangstroth/vim-racket'
|
||||
@ -25,6 +25,8 @@ Plug 'guersam/vim-j'
|
||||
Plug 'wlangstroth/vim-racket'
|
||||
Plug 'derekelkins/agda-vim'
|
||||
Plug 'ftorres16/spice.vim'
|
||||
Plug 'vmware/differential-datalog', {'rtp': 'tools/vim'}
|
||||
Plug 'FStarLang/VimFStar', {'for': 'fstar'}
|
||||
|
||||
" Themes
|
||||
Plug 'arcticicestudio/nord-vim'
|
||||
@ -34,6 +36,12 @@ Plug 'junegunn/goyo.vim'
|
||||
Plug 'iamcco/markdown-preview.vim'
|
||||
Plug 'junegunn/limelight.vim'
|
||||
Plug 'luochen1990/rainbow'
|
||||
Plug 'simrat39/symbols-outline.nvim'
|
||||
Plug 'folke/todo-comments.nvim'
|
||||
|
||||
" Misc
|
||||
Plug 'nvim-lua/plenary.nvim'
|
||||
Plug 'airblade/vim-gitgutter'
|
||||
call plug#end()
|
||||
|
||||
set exrc " Execute local vimscripts
|
||||
@ -42,16 +50,14 @@ set expandtab " Expand tabs into spaces
|
||||
set number " Set line numbers
|
||||
set mouse=a " Allow mouse
|
||||
set signcolumn=yes " Always show extra column
|
||||
set guifont=Iosevka " Use Ioeska in frontends.
|
||||
set guifont=Iosevka:h35 " Use Ioeska in frontends.
|
||||
set hidden
|
||||
|
||||
autocmd BufEnter * call ncm2#enable_for_buffer() " Enable ncm2 for all buffers
|
||||
autocmd BufRead,BufNewFile *.v set filetype=coq " Coq is not Verilog
|
||||
autocmd BufNewFile,BufRead *.cir set filetype=spice " LTSpice is Spice
|
||||
autocmd BufRead,BufNewFile *.dl set filetype=dl " Datalog is Datalog
|
||||
autocmd FileType crystal setlocal shiftwidth=2 " Crystal likes 2-wide indent
|
||||
|
||||
set completeopt=noinsert,menuone
|
||||
|
||||
" Settings for Rainbow
|
||||
let g:rainbow_active = 1
|
||||
|
||||
@ -60,9 +66,9 @@ let g:limelight_conceal_ctermfg = 8
|
||||
|
||||
" Settings for Vim's LaTeX plugin
|
||||
let g:tex_flavor = 'latex'
|
||||
|
||||
" Settings for deoplete
|
||||
let g:deoplete#enable_at_startup = 1
|
||||
let g:vimtex_quickfix_open_on_warning = 0
|
||||
let g:vimtex_view_general_viewer = 'okular'
|
||||
let g:vimtex_view_general_options = '--unique file:@pdf\#src:@line@tex'
|
||||
|
||||
" Settings for UltiSnips
|
||||
let g:UltiSnipsExpandTrigger="<tab>"
|
||||
@ -77,35 +83,30 @@ let g:neovide_cursor_vfx_mode="ripple"
|
||||
|
||||
colorscheme nord
|
||||
|
||||
" Language Client settings
|
||||
let g:LanguageClient_selectionUI = "fzf"
|
||||
let g:LanguageClient_hasSnippetSupport = 0
|
||||
let g:LanguageClient_serverCommands = {
|
||||
\ 'haskell': ['haskell-language-server-wrapper', '--lsp'],
|
||||
\ 'rust': ['rls'],
|
||||
\ 'c': ['clangd'],
|
||||
\ 'crystal': ['/home/vanilla/software/crystalline/crystalline'],
|
||||
\ 'cpp': ['clangd'],
|
||||
\ 'javascript': ['javascript-typescript-stdio'],
|
||||
\ 'elm': ['elm-language-server', '--stdio'],
|
||||
\ 'python': ['python', '-m', 'pyls'],
|
||||
\ 'elixir': ['/home/vanilla/software/elixir-ls/language_server.sh']
|
||||
\ }
|
||||
let g:LanguageClient_diagnosticsDisplay = {
|
||||
\ 1: {"name": "Error","texthl": "ALEError","signText": ">>","signTexthl": "ALEErrorSign",},
|
||||
\ 2: {"name": "Warning","texthl": "ALEWarning","signText": ">>","signTexthl": "ALEWarningSign",},
|
||||
\ 3: {"name": "Information","texthl": "ALEInfo","signText": ">>","signTexthl": "ALEInfoSign",},
|
||||
\ 4: {"name": "Hint","texthl": "ALEInfo","signText": ">>","signTexthl": "ALEInfoSign",},}
|
||||
let g:LanguageClient_rootMarkers = {
|
||||
\ 'haskell': ['.git'],
|
||||
\ 'crystal': ['.git'],
|
||||
\ 'elm': ['elm.json'],
|
||||
\ }
|
||||
lua require('lspconfig').hls.setup{}
|
||||
lua require('lspconfig').rls.setup{}
|
||||
lua require('lspconfig').clangd.setup{}
|
||||
lua require('lspconfig').tsserver.setup{}
|
||||
lua require('lspconfig').elmls.setup{}
|
||||
lua require('lspconfig').pylsp.setup{}
|
||||
|
||||
" nmap <silent>K <Plug>(lcn-menu)
|
||||
nmap <silent>M <cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>
|
||||
nmap <silent>? <cmd>lua vim.lsp.buf.hover()<CR>
|
||||
nmap <silent>K <cmd>lua vim.lsp.buf.rename()<CR>
|
||||
|
||||
" Ctrl-e to open file in new tab (or jump to it)
|
||||
nmap <c-e> :Files<CR>
|
||||
nmap <silent>K <Plug>(lcn-menu)
|
||||
nmap <silent>M <Plug>(lcn-explain-error)
|
||||
nmap <silent>? <Plug>(lcn-hover)
|
||||
|
||||
" Autocompletion
|
||||
set completeopt=menuone,noselect
|
||||
let g:compe = {}
|
||||
let g:compe.enabled = v:true
|
||||
let g:compe.source = {
|
||||
\ 'path': v:true,
|
||||
\ 'buffer': v:true,
|
||||
\ 'nvim_lsp': v:true,
|
||||
\ }
|
||||
|
||||
" Racket settings
|
||||
au BufReadPost *.rkt,*.rktl set filetype=racket
|
||||
@ -117,3 +118,9 @@ function! g:CoqtailHighlight()
|
||||
hi default link CoqtailChecked Visual
|
||||
hi default link CoqtailSent PmenuSel
|
||||
endfunction
|
||||
|
||||
lua << EOF
|
||||
require("todo-comments").setup {
|
||||
search = { command = "ag", },
|
||||
}
|
||||
EOF
|
||||
|
Loading…
Reference in New Issue
Block a user