Major cleanup for pop os minimal config.
This commit is contained in:
@@ -18,7 +18,6 @@ set number
|
||||
set relativenumber
|
||||
set wildmenu
|
||||
set showcmd
|
||||
colorscheme jellybeans
|
||||
|
||||
" ----------------------------------------------------------------------------
|
||||
" Transparent UI
|
||||
@@ -59,19 +58,6 @@ set completeopt=menu,menuone,noselect
|
||||
syntax on
|
||||
filetype plugin indent on
|
||||
|
||||
" ----------------------------------------------------------------------------
|
||||
" fzf
|
||||
" ----------------------------------------------------------------------------
|
||||
if executable('rg')
|
||||
let $FZF_DEFAULT_COMMAND =
|
||||
\ 'rg --files --hidden --follow --glob "!.git/*"'
|
||||
endif
|
||||
|
||||
nnoremap <C-p> :Files<CR>
|
||||
nnoremap <C-o> :Buffers<CR>
|
||||
nnoremap <C-s> :Rg<CR>
|
||||
nnoremap <C-b> :Build<CR>
|
||||
|
||||
" ----------------------------------------------------------------------------
|
||||
" Search
|
||||
" ----------------------------------------------------------------------------
|
||||
@@ -88,72 +74,6 @@ nnoremap <C-k> <C-w>k
|
||||
nnoremap <C-l> <C-w>l
|
||||
nnoremap <C-x> <C-w>q
|
||||
|
||||
" ----------------------------------------------------------------------------
|
||||
" LSP - OLS
|
||||
" ----------------------------------------------------------------------------
|
||||
packadd lsp
|
||||
call LspOptionsSet(#{
|
||||
\ autoComplete: v:false,
|
||||
\ autoHighlight: v:false,
|
||||
\ autoHighlightDiags: v:true,
|
||||
\ autoPopulateDiags: v:true,
|
||||
\ semanticHighlight: v:false,
|
||||
\ showSignature: v:false,
|
||||
\ completionInPreview: v:false,
|
||||
\ condensedCompletionMenu: v:true,
|
||||
\ })
|
||||
|
||||
if executable('ols')
|
||||
call LspAddServer([#{
|
||||
\ name: 'ols',
|
||||
\ filetype: ['odin'],
|
||||
\ path: 'ols',
|
||||
\ args: ['--stdio'],
|
||||
\ features: #{
|
||||
\ diagnostic: v:false,
|
||||
\ completion: v:true,
|
||||
\ hover: v:true,
|
||||
\ signatureHelp: v:false,
|
||||
\ documentHighlight: v:true,
|
||||
\ semanticHighlight: v:true,
|
||||
\ },
|
||||
\ }])
|
||||
endif
|
||||
|
||||
command! Action LspCodeAction
|
||||
command! Rename LspRename
|
||||
|
||||
autocmd FileType odin setlocal omnifunc=LspOmniFunc
|
||||
inoremap <C-@> <C-X><C-O>
|
||||
nnoremap K :LspHover<CR>
|
||||
|
||||
" ----------------------------------------------------------------------------
|
||||
" Go to Definition
|
||||
" ----------------------------------------------------------------------------
|
||||
function! GotoDefinitionSplit() abort
|
||||
vsplit
|
||||
LspGotoDefinition
|
||||
endfunction
|
||||
|
||||
nnoremap gd :call GotoDefinitionSplit()<CR>
|
||||
|
||||
" ----------------------------------------------------------------------------
|
||||
" Diagnostics
|
||||
" ----------------------------------------------------------------------------
|
||||
function! ToggleDiagnostics() abort
|
||||
for l:win in getwininfo()
|
||||
if get(l:win, 'quickfix', 0)
|
||||
execute l:win.winnr .. 'close'
|
||||
return
|
||||
endif
|
||||
endfor
|
||||
|
||||
LspDiag show
|
||||
endfunction
|
||||
|
||||
command! Diagnostics call ToggleDiagnostics()
|
||||
nnoremap <C-i> :Diagnostics<CR>
|
||||
|
||||
" ----------------------------------------------------------------------------
|
||||
" Netrw / File Tree
|
||||
" ----------------------------------------------------------------------------
|
||||
@@ -164,39 +84,3 @@ let g:netrw_altv = 1
|
||||
let g:netrw_winsize = 33
|
||||
let g:netrw_keepdir = 0
|
||||
nnoremap <C-e> :Lexplore<CR>
|
||||
|
||||
" ----------------------------------------------------------------------------
|
||||
" Build System
|
||||
" ----------------------------------------------------------------------------
|
||||
function! Build(...) abort
|
||||
" Already in the build terminal → close it.
|
||||
if get(b:, 'build_terminal', 0) && &buftype ==# 'terminal'
|
||||
close
|
||||
echo ''
|
||||
return
|
||||
endif
|
||||
|
||||
if !filereadable('build.sh')
|
||||
echohl WarningMsg
|
||||
echo 'No build.sh found in current directory.'
|
||||
echohl None
|
||||
return
|
||||
endif
|
||||
|
||||
wall
|
||||
|
||||
let l:command = './build.sh'
|
||||
|
||||
if a:0 > 0
|
||||
let l:command .= ' ' .. join(a:000, ' ')
|
||||
endif
|
||||
|
||||
botright vsplit
|
||||
execute 'vertical resize ' .. float2nr(&columns * 0.37)
|
||||
execute 'terminal ++curwin ' .. l:command
|
||||
|
||||
let b:build_terminal = 1
|
||||
tnoremap <buffer> <CR> <Nop>
|
||||
endfunction
|
||||
|
||||
command! -nargs=* Build call Build(<f-args>)
|
||||
|
||||
Reference in New Issue
Block a user