Compare commits

...

13 Commits

Author SHA1 Message Date
Danila Fedorin
255aec5a3c Update for Neovim 0.10.0
Signed-off-by: Danila Fedorin <daniel.fedorin@hpe.com>
2024-05-19 22:32:37 -07:00
Danila Fedorin
55e6c796b7 Adjust tmux to work well with Neovim 0.10 in Alacritty
Signed-off-by: Danila Fedorin <daniel.fedorin@hpe.com>
2024-05-19 22:32:37 -07:00
e6eb69e31b Merge remote-tracking branch 'origin/master' 2024-02-10 14:33:40 -08:00
4bf96b1296 Add more vim config changes
Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
2024-02-10 14:32:07 -08:00
Danila Fedorin
3e6a62b798 Configure CLS and chplcheck
Signed-off-by: Danila Fedorin <daniel.fedorin@hpe.com>
2024-02-10 14:30:42 -08:00
Danila Fedorin
7747bb47e2 Pull some changes from the work machine 2023-08-30 09:11:18 -07:00
Danila Fedorin
14e15062ac Add some Chapel-specific changes 2023-02-14 09:23:00 -08:00
934920a052 Reduce the gaps. I really don't need that much space. 2022-06-03 15:53:46 -07:00
771f79cde4 Comment out deprecated property 2022-06-03 15:49:07 -07:00
edc3ccce17 Update snippet lists 2022-06-03 15:48:35 -07:00
cedb3a802a Update vim plug 2022-06-03 15:48:13 -07:00
6c8524d0e7 Update configuration to use neovim's internal language server support 2022-06-03 15:47:59 -07:00
b356636de7 Add more languages and plugins 2021-08-16 13:20:03 -07:00
7 changed files with 209 additions and 57 deletions

View File

@@ -184,7 +184,7 @@ bell:
duration: 0
# Background opacity
background_opacity: 1.0
# background_opacity: 1.0
# Mouse bindings
#

View File

@@ -180,7 +180,7 @@ exec_always --no-startup-id compton
# Remove window borders
for_window [class="^.*"] border pixel 2
# Set up gaps
gaps inner 20
gaps inner 5
# Browser shortcut
bindsym $mod+Shift+b exec firefox
# Compton shortcut
@@ -192,6 +192,6 @@ bindsym $mod+Shift+s exec scrot
bindsym $mod+Shift+f exec scrot -s
bindsym $mod+Shift+o exec alacritty --command ~/projects/ppl-cli/script/open_float.sh
client.focused #436394 #436394 #436394 #436394 #436394
client.focused #428df5 #428df5 #428df5 #428df5 #428df5
client.focused_inactive #2e3440 #2e3440 #2e3440 #2e3440 #2e3440
client.unfocused #2e3440 #2e3440 #2e3440 #2e3440 #2e3440

View 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

View File

@@ -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

View File

@@ -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)
return
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
let name = s:find_name(line('.'))
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

View File

@@ -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,11 @@ 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'}
Plug 'purescript-contrib/purescript-vim'
" Plug '~/Documents/software/chapel/highlight/vim'
" Plug 'ashinkarov/nvim-agda'
" Themes
Plug 'arcticicestudio/nord-vim'
@@ -34,6 +39,19 @@ 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'
" AI (Yes, you heard me)
Plug 'aduros/ai.vim'
Plug 'github/copilot.vim'
" Misc
Plug 'uga-rosa/utf8.nvim'
Plug 'nvim-lua/plenary.nvim'
Plug 'airblade/vim-gitgutter'
Plug 'f-person/git-blame.nvim'
Plug 'wakatime/vim-wakatime'
call plug#end()
set exrc " Execute local vimscripts
@@ -42,15 +60,19 @@ 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 ColorScheme * highlight ExtraWhitespace ctermbg=red guibg=red
autocmd ColorScheme * highlight Comment ctermfg=green
autocmd BufWinEnter * match ExtraWhitespace /\s\+$/ " Highlight trailing whitespace
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
autocmd FileType cpp setlocal shiftwidth=2 " Chapel has two-wide indents
autocmd BufRead,BufNewFile *.ast set filetype=ast " AST files are from Chapel.
autocmd VimEnter * Copilot enable
" Settings for Rainbow
let g:rainbow_active = 1
@@ -60,9 +82,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>"
@@ -76,36 +98,44 @@ let g:fzf_action = { 'enter': 'tab drop' }
let g:neovide_cursor_vfx_mode="ripple"
colorscheme nord
hi Comment guifg=#A3BE8C
" 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{}
lua require('lspconfig').purescriptls.setup{}
lua require('lspconfig').pyright.setup{}
" All these language servers can be used for symbols-outline
lua require("symbols-outline").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>
nmap <silent><space>d <cmd>lua vim.lsp.buf.definition()<CR>
nmap <silent><space>D <cmd>lua vim.lsp.buf.declaration()<CR>
nmap <silent><space>i <cmd>lua vim.lsp.buf.implementation()<CR>
nmap <silent><space>r <cmd>lua vim.lsp.buf.references()<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,
\ }
" Highlight 80th column
let &colorcolumn="80,".join(range(120,999),",")
" Racket settings
au BufReadPost *.rkt,*.rktl set filetype=racket
@@ -117,3 +147,42 @@ function! g:CoqtailHighlight()
hi default link CoqtailChecked Visual
hi default link CoqtailSent PmenuSel
endfunction
lua << EOF
local lspconfig = require 'lspconfig'
local configs = require 'lspconfig.configs'
local util = require 'lspconfig.util'
local todocomments = require 'todo-comments'
todocomments.setup {
search = { command = "ag", },
}
configs.chplcheck = {
default_config = {
cmd = {"chplcheck", "--lsp", "--enable-rule", "UnusedFormal", "--enable-rule", "UnusedLoopIndex"},
filetypes = {'chpl'},
autostart = true,
single_file_support = true,
root_dir = util.find_git_ancestor,
settings = {},
},
}
configs.chpllsp = {
default_config = {
cmd = {"/Users/daniel.fedorin/Documents/software/chapel/tools/chpl-language-server/chpl-language-server", "--resolver"},
filetypes = {'chpl'},
autostart = true,
single_file_support = true,
root_dir = util.find_git_ancestor,
settings = {},
},
}
lspconfig.chplcheck.setup{}
lspconfig.chpllsp.setup{}
vim.cmd("autocmd BufRead,BufNewFile *.chpl set filetype=chpl")
vim.lsp.inlay_hint.enable(true, nil)
EOF

View File

@@ -1,2 +1,4 @@
set mouse
set -sg escape-time 0
set -g default-terminal "screen-256color"
set -ag terminal-overrides ",xterm-256color:RGB"