From c052acd2bb326d286bb3496f3e4400df6b020ec5 Mon Sep 17 00:00:00 2001 From: Matt Wiseley Date: Tue, 6 Jan 2026 13:32:47 -0500 Subject: [PATCH] Use plugin for wrapping --- custom-lang-configs.vim | 79 +++++++++++++++++++++++++++++++++++++++++ init.vim | 39 ++++++++++++-------- 2 files changed, 104 insertions(+), 14 deletions(-) create mode 100644 custom-lang-configs.vim diff --git a/custom-lang-configs.vim b/custom-lang-configs.vim new file mode 100644 index 0000000..47d781d --- /dev/null +++ b/custom-lang-configs.vim @@ -0,0 +1,79 @@ +" Removed from init.vim until plugins referenced here are enabled + +" 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 u :call phpactor#UseAdd() +" Invoke the context menu +nmap mm :call phpactor#ContextMenu() +" Invoke the navigation menu +nmap nn :call phpactor#Navigate() +" Goto definition of class or class member under the cursor +nmap oo :call phpactor#GotoDefinition() +nmap oh :call phpactor#GotoDefinition('hsplit') +nmap ov :call phpactor#GotoDefinition('vsplit') +nmap ot :call phpactor#GotoDefinition('tabnew') +" Show brief information about the symbol under the cursor +nmap K :call phpactor#Hover() +" Transform the classes in the current file +nmap tt :call phpactor#Transform() +" Generate a new class (replacing the current file) +nmap cc :call phpactor#ClassNew() +" Extract expression (normal mode) +nmap ee :call phpactor#ExtractExpression(v:false) +" Extract expression from selection +vmap ee :call phpactor#ExtractExpression(v:true) +" Extract method from selection +vmap em :call phpactor#ExtractMethod() + + +" 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 = "g" +let g:jedi#goto_definitions_command = "d" +let g:jedi#documentation_command = "K" +let g:jedi#usages_command = "n" +let g:jedi#rename_command = "r" +let g:jedi#show_call_signatures = "0" +let g:jedi#completions_command = "" +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 + + + diff --git a/init.vim b/init.vim index 831426c..d9bdca3 100644 --- a/init.vim +++ b/init.vim @@ -1,5 +1,3 @@ -" vim-bootstrap 2026-01-05 15:36:51 - "***************************************************************************** "" Vim-Plug core "***************************************************************************** @@ -30,6 +28,7 @@ call plug#begin(expand('~/.config/nvim/plugged')) "***************************************************************************** "" Plug install packages "***************************************************************************** +" file management Plug 'scrooloose/nerdtree' Plug 'jistr/vim-nerdtree-tabs' " coding comments @@ -54,6 +53,7 @@ Plug 'Raimondi/delimitMate' Plug 'Yggdroot/indentLine' " bootstrap support "Plug 'editor-bootstrap/vim-bootstrap-updater' +Plug 'andrewferrier/wrapping.nvim' "Autoreload files when changed externally Plug 'TheZoq2/neovim-auto-autoread' @@ -210,7 +210,7 @@ colorscheme molokai set wildmenu " mouse support -set mouse= +set mouse=a set mousemodel=popup set t_Co=256 @@ -299,10 +299,10 @@ nnoremap :NERDTreeFind nnoremap :NERDTreeToggle " grep.vim -nnoremap f :Rgrep -let Grep_Default_Options = '-IR' -let Grep_Skip_Files = '*.log *.db' -let Grep_Skip_Dirs = '.git node_modules' +"nnoremap f :Rgrep +"let Grep_Default_Options = '-IR' +"let Grep_Skip_Files = '*.log *.db' +"let Grep_Skip_Dirs = '.git node_modules' " terminal emulation nnoremap sh :terminal @@ -322,7 +322,8 @@ if !exists('*s:setupWrapping') set wrap set linebreak set wm=2 - set textwidth=0 + set nolist "hide non-printable chars + set textwidth=79 set wrapmargin=0 set breakat=\ \t!@%*[]<>;:/? nnoremap j gj @@ -346,11 +347,11 @@ augroup vimrc-remember-cursor-position augroup END "" txt and markdown -augroup vimrc-wrapping - autocmd! - autocmd BufRead,BufNewFile *.txt call s:setupWrapping() - autocmd BufRead,BufNewFile *.md call s:setupWrapping() -augroup END +"augroup vimrc-wrapping +"" autocmd! +"" autocmd BufRead,BufNewFile,BufWinEnter *.txt call s:setupWrapping() +"" autocmd BufRead,BufNewFile,BufWinEnter *.md call s:setupWrapping() +"augroup END "" make/cmake augroup vimrc-make-cmake @@ -490,6 +491,7 @@ nnoremap o :.GBrowse "" Custom configs "***************************************************************************** +" See custom-lang-configs.vim for language-specific configs, copy here has needed "***************************************************************************** "***************************************************************************** @@ -557,11 +559,20 @@ if status_ok then end EOF +" Remove icons from the gutter next to markdown headings lua << EOF require('render-markdown').setup({ heading = { - -- Set this to false to remove icons from the gutter next to headings sign = false, }, }) EOF + +" wrapping.nvim setup +lua << EOF +require("wrapping").setup({ + notify_on_switch = true, + softener = { markdown = true, text = true } +}) + +EOF