Merged home & work configs
This commit is contained in:
@ -1,10 +0,0 @@
|
||||
-- Soft wrap at the word
|
||||
vim.opt_local.wrap = true -- Enable wrapping
|
||||
vim.opt_local.linebreak = true -- Wrap at words, not in the middle of a word
|
||||
vim.opt_local.breakindent = true -- Keep the same indentation on wrapped lines
|
||||
|
||||
-- Navigation fix
|
||||
-- By default, 'j' and 'k' jump physical lines.
|
||||
-- These remaps make them move by visual lines.
|
||||
vim.keymap.set('n', 'j', 'gj', { buffer = true })
|
||||
vim.keymap.set('n', 'k', 'gk', { buffer = true })
|
||||
119
init.vim
119
init.vim
@ -1,7 +1,9 @@
|
||||
" vim-bootstrap 2026-01-05 15:36:51
|
||||
|
||||
"*****************************************************************************
|
||||
"" Vim-Plug core
|
||||
"*****************************************************************************
|
||||
let vimplug_exists=expand('~/.config/nvim/autoload/plug.vim')
|
||||
let vimplug_exists=expand('~/./autoload/plug.vim')
|
||||
let curl_exists=expand('curl')
|
||||
|
||||
let g:vim_bootstrap_langs = "html,javascript,lua,php,python"
|
||||
@ -28,7 +30,6 @@ call plug#begin(expand('~/.config/nvim/plugged'))
|
||||
"*****************************************************************************
|
||||
"" Plug install packages
|
||||
"*****************************************************************************
|
||||
" file management
|
||||
Plug 'scrooloose/nerdtree'
|
||||
Plug 'jistr/vim-nerdtree-tabs'
|
||||
" coding comments
|
||||
@ -157,7 +158,7 @@ filetype plugin indent on
|
||||
set encoding=utf-8
|
||||
set fileencoding=utf-8
|
||||
set fileencodings=utf-8
|
||||
|
||||
set ttyfast
|
||||
|
||||
"" Fix backspace indent
|
||||
set backspace=indent,eol,start
|
||||
@ -213,8 +214,8 @@ set mouse=
|
||||
|
||||
set mousemodel=popup
|
||||
set t_Co=256
|
||||
set gfn=Monospace\ 10
|
||||
"set guioptions=egmrti
|
||||
set gfn=Monospace\ 10
|
||||
|
||||
if has("gui_running")
|
||||
if has("gui_mac") || has("gui_macvim")
|
||||
@ -228,13 +229,16 @@ else
|
||||
let g:indentLine_concealcursor = ''
|
||||
let g:indentLine_char = '┆'
|
||||
let g:indentLine_faster = 1
|
||||
|
||||
endif
|
||||
|
||||
"" Disable the blinking cursor.
|
||||
set gcr=a:blinkon0
|
||||
|
||||
au TermEnter * setlocal scrolloff=0
|
||||
au TermLeave * setlocal scrolloff=3
|
||||
set scrolloff=3
|
||||
" alt to above, not sure what the diff is
|
||||
"au TermEnter * setlocal scrolloff=0
|
||||
"au TermLeave * setlocal scrolloff=3
|
||||
|
||||
|
||||
"" Status bar
|
||||
@ -316,8 +320,13 @@ command! FixWhitespace :%s/\s\+$//e
|
||||
if !exists('*s:setupWrapping')
|
||||
function s:setupWrapping()
|
||||
set wrap
|
||||
set linebreak
|
||||
set wm=2
|
||||
set textwidth=79
|
||||
set textwidth=0
|
||||
set wrapmargin=0
|
||||
set breakat=\ \t!@%*[]<>;:/?
|
||||
nnoremap <silent> <buffer> j gj
|
||||
nnoremap <silent> <buffer> k gk
|
||||
endfunction
|
||||
endif
|
||||
|
||||
@ -336,10 +345,11 @@ augroup vimrc-remember-cursor-position
|
||||
autocmd BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
|
||||
augroup END
|
||||
|
||||
"" txt
|
||||
"" txt and markdown
|
||||
augroup vimrc-wrapping
|
||||
autocmd!
|
||||
autocmd BufRead,BufNewFile *.txt call s:setupWrapping()
|
||||
autocmd BufRead,BufNewFile *.md call s:setupWrapping()
|
||||
augroup END
|
||||
|
||||
"" make/cmake
|
||||
@ -414,10 +424,10 @@ nnoremap <silent> <leader>e :FZF -m<CR>
|
||||
nmap <leader>y :History:<CR>
|
||||
|
||||
" snippets
|
||||
let g:UltiSnipsExpandTrigger="<tab>"
|
||||
let g:UltiSnipsJumpForwardTrigger="<tab>"
|
||||
let g:UltiSnipsJumpBackwardTrigger="<c-b>"
|
||||
let g:UltiSnipsEditSplit="vertical"
|
||||
"let g:UltiSnipsExpandTrigger="<tab>"
|
||||
"let g:UltiSnipsJumpForwardTrigger="<tab>"
|
||||
"let g:UltiSnipsJumpBackwardTrigger="<c-b>"
|
||||
"let g:UltiSnipsEditSplit="vertical"
|
||||
|
||||
" ale
|
||||
let g:ale_linters = {}
|
||||
@ -480,82 +490,6 @@ nnoremap <Leader>o :.GBrowse<CR>
|
||||
"" Custom configs
|
||||
"*****************************************************************************
|
||||
|
||||
" html
|
||||
" for html files, 2 spaces
|
||||
autocmd Filetype html setlocal ts=2 sw=2 expandtab
|
||||
|
||||
|
||||
" javascript
|
||||
let g:javascript_enable_domhtmlcss = 1
|
||||
|
||||
" vim-javascript
|
||||
augroup vimrc-javascript
|
||||
autocmd!
|
||||
autocmd FileType javascript setl tabstop=4|setl shiftwidth=4|setl expandtab softtabstop=4
|
||||
augroup END
|
||||
|
||||
|
||||
" lua
|
||||
|
||||
|
||||
" php
|
||||
" Phpactor plugin
|
||||
" Include use statement
|
||||
nmap <Leader>u :call phpactor#UseAdd()<CR>
|
||||
" Invoke the context menu
|
||||
nmap <Leader>mm :call phpactor#ContextMenu()<CR>
|
||||
" Invoke the navigation menu
|
||||
nmap <Leader>nn :call phpactor#Navigate()<CR>
|
||||
" Goto definition of class or class member under the cursor
|
||||
nmap <Leader>oo :call phpactor#GotoDefinition()<CR>
|
||||
nmap <Leader>oh :call phpactor#GotoDefinition('hsplit')<CR>
|
||||
nmap <Leader>ov :call phpactor#GotoDefinition('vsplit')<CR>
|
||||
nmap <Leader>ot :call phpactor#GotoDefinition('tabnew')<CR>
|
||||
" Show brief information about the symbol under the cursor
|
||||
nmap <Leader>K :call phpactor#Hover()<CR>
|
||||
" Transform the classes in the current file
|
||||
nmap <Leader>tt :call phpactor#Transform()<CR>
|
||||
" Generate a new class (replacing the current file)
|
||||
nmap <Leader>cc :call phpactor#ClassNew()<CR>
|
||||
" Extract expression (normal mode)
|
||||
nmap <silent><Leader>ee :call phpactor#ExtractExpression(v:false)<CR>
|
||||
" Extract expression from selection
|
||||
vmap <silent><Leader>ee :<C-U>call phpactor#ExtractExpression(v:true)<CR>
|
||||
" Extract method from selection
|
||||
vmap <silent><Leader>em :<C-U>call phpactor#ExtractMethod()<CR>
|
||||
|
||||
|
||||
" python
|
||||
" vim-python
|
||||
augroup vimrc-python
|
||||
autocmd!
|
||||
autocmd FileType python setlocal expandtab shiftwidth=4 tabstop=8 colorcolumn=79
|
||||
\ formatoptions+=croq softtabstop=4
|
||||
\ cinwords=if,elif,else,for,while,try,except,finally,def,class,with
|
||||
augroup END
|
||||
|
||||
" jedi-vim
|
||||
let g:jedi#popup_on_dot = 0
|
||||
let g:jedi#goto_assignments_command = "<leader>g"
|
||||
let g:jedi#goto_definitions_command = "<leader>d"
|
||||
let g:jedi#documentation_command = "K"
|
||||
let g:jedi#usages_command = "<leader>n"
|
||||
let g:jedi#rename_command = "<leader>r"
|
||||
let g:jedi#show_call_signatures = "0"
|
||||
let g:jedi#completions_command = "<C-Space>"
|
||||
let g:jedi#smart_auto_mappings = 0
|
||||
|
||||
" ale
|
||||
:call extend(g:ale_linters, {
|
||||
\'python': ['flake8'], })
|
||||
|
||||
" vim-airline
|
||||
let g:airline#extensions#virtualenv#enabled = 1
|
||||
|
||||
" Syntax highlight
|
||||
let python_highlight_all = 1
|
||||
|
||||
|
||||
|
||||
"*****************************************************************************
|
||||
"*****************************************************************************
|
||||
@ -608,7 +542,6 @@ endif
|
||||
" Seemless clipboard integration
|
||||
set clipboard+=unnamedplus
|
||||
|
||||
" Treesitter config for markdown
|
||||
" Treesitter config for markdown
|
||||
lua << EOF
|
||||
-- Check if the module exists before trying to require it
|
||||
@ -624,3 +557,11 @@ if status_ok then
|
||||
end
|
||||
EOF
|
||||
|
||||
lua << EOF
|
||||
require('render-markdown').setup({
|
||||
heading = {
|
||||
-- Set this to false to remove icons from the gutter next to headings
|
||||
sign = false,
|
||||
},
|
||||
})
|
||||
EOF
|
||||
|
||||
Reference in New Issue
Block a user