| Summary: | editors/vim: provided vimrc duplicates config from "source $VIMRUNTIME/defaults.vim" | ||
|---|---|---|---|
| Product: | Ports & Packages | Reporter: | Michael Osipov <michael.osipov> |
| Component: | Individual Port(s) | Assignee: | Adam Weinberger <adamw> |
| Status: | Closed Works As Intended | ||
| Severity: | Affects Some People | CC: | michael.osipov |
| Priority: | --- | Flags: | bugzilla:
maintainer-feedback?
(adamw) |
| Version: | Latest | ||
| Hardware: | Any | ||
| OS: | Any | ||
I believe that this patch should do it:
root@deblndw013x3j:/usr/local/etc/vim
# diff vimrc.sample vimrc | pcdiff
--- vimrc.sample 2022-07-06 14:46:54.191216000 +0200
+++ vimrc 2022-08-01 09:53:53.585717000 +0200
@@ -3,25 +3,13 @@
source $VIMRUNTIME/defaults.vim
let skip_defaults_vim = 1
-set nocompatible " Enable Vim mode (instead of vi emulation)
-
let g:is_posix = 1 " Our /bin/sh is POSIX, not bash
set autoindent " Intelligent indentation matching
set autoread " Update the file if it's changed externally
-set backspace=indent,eol,start " Allow backspacing over anything
set belloff=all " Turn off bells
-set display=truncate " Show '@@@' when the last screen line overflows
set formatoptions+=j " Delete comment char when joining lines
-set history=100 " Undo up to this many commands
set hlsearch " Highlight search results
-set incsearch " Highlight search matches as you type them
-set ruler " Show cursor position
set ttyfast " Redraw faster for smoother scrolling
-set wildmenu " Show menu for tab completion in command mode
-
-try
- syntax on " Enable syntax highlighting
-catch | endtry " vim-tiny is installed without the syntax files
if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
set fileencodings=ucs-bom,utf-8,latin1
Hi Michael, Unfortunately, this won't work for vim-tiny. The vim-tiny package installs an empty $VIMRUNTIME/defaults.vim and relies entirely on the settings in our vimrc. If we install vim's defaults.vim for vim-tiny, then it errors on a missing syntax.vim. If we install the syntax.vim, it errors for missing syntax files. The only way to keep vim-tiny with no runtime is to skip vim's defaults.vim entirely. So, if anything, perhaps //more// settings should be considered for duplication into our provided vimrc. I'm glad you brought this up, though. I'm going to put a comment into our vimrc explaining why the unusual duplication takes place. A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=8380febbf30620bc0833a9eac823b54f4799ad49 commit 8380febbf30620bc0833a9eac823b54f4799ad49 Author: Adam Weinberger <adamw@FreeBSD.org> AuthorDate: 2022-08-01 13:44:44 +0000 Commit: Adam Weinberger <adamw@FreeBSD.org> CommitDate: 2022-08-01 13:47:55 +0000 editors/vim: Add some explanatory comments to the vimrc Our vimrc duplicates settings from $VIMRUNTIME/defaults.vim, which appears odd. However, it's actually required because of vim-tiny. vim-tiny installs an empty defaults.vim stub, meaning that it only gets the settings that appear in our vimrc. PR: 265502 editors/vim/files/vimrc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (In reply to Adam Weinberger from comment #2) Adam, this explanation is good enough for me. Thank you! |
$VIMRUNTIME/defaults.vim already contains ============ if &compatible set nocompatible endif set backspace=indent,eol,start set display=truncate set ruler set wildmenu if &t_Co > 2 || has("gui_running") " Revert with ":syntax off". syntax on endif ============ Please review and trim down as necessary.