gpt4 book ai didi

vim - MacVim 中的第二行被第一行的 tabstop 关闭

转载 作者:行者123 更新时间:2023-12-02 22:40:20 27 4
gpt4 key购买 nike

我每天使用 MacVim 记下一些笔记。第二行在日期后缩进 8 个空格(制表位),如下所示。

Dec 15th (Sun):
John got a minor injury while playing. Wanted to take him to a
doctor but it was late Sunday night. Only ER was open
during those hours which cost us a lot for a small issue.

我不想要第二行有多余的空间。我希望它看起来像:

Dec 15th (Sun):
John got a minor injury while playing. Wanted to take him to a doctor
but it was late Sunday night. Only ER was open during those hours which
cost us a lot for a small issue.

如果第一行末尾有句号 .,则不会发生此问题。到目前为止,当(a)第一行末尾有冒号(如本例所示)(b)如果第二行是第一行的延续时,就会发生这种情况。

我的.vimrc文件:

"execute pathogen#infect()call pathogen#infect() syntax on filetype plugin indent on "mappings "nmap  a=strftime("%Y-%m-%d %a %I:%M %p")"imap  =strftime("%Y-%m-%d %a %I:%M %p")nmap  a=strftime("[%I:%M%p]")imap  =strftime("[%I:%M%p]")set autoindentset incsearch   " incremental search  set hlsearchset nuset textwidth=74set ruler       " show line & column # of cursor position. When there is                " room, relative position of the text is shown w.r.t start                " of file set timeoutlen=4000  " 4 sec timeout instead of default 1 sec for                     " operations involving multiple keys such as tmux &                     " screenset mouse=a          " Allow mouse operations. Currently not working. set cindent          " Appropriate for c sntax. Look :help C-indenting   set tabstop=8        " tab is 4 spaces long "set shiftwidth       " set expandtab        " replace tabs with 4 spaces "autocmd vimenter * NERDTree    " Load NERDTree whenever Vim starts set runtimepath^=~/.vim/bundle/ctrlp.vim " load CTRL-P plugin when Vim starts "set nocompatible      " by default

有人可以告诉我如何解决这个问题吗?

最佳答案

您同时拥有 :set autoindent ,及以后 :set cindent 。后者覆盖前者,并对您所提示的行为负责,因为它错误地解释了 text:作为标签。

如果您只想启用某些文件类型的选项,请使用 :setlocal cindent相反,并输入相应的 :setlocal命令输入~/.vim/after/ftplugin/<filetype>.vim ,其中<filetype>是实际的文件类型(例如 c )。 (这要求您有 :filetype plugin on ;使用 after 目录允许您覆盖 $VIMRUNTIME/ftplugin/<filetype>.vim 完成的任何默认文件类型设置。)

或者,您可以定义 :autocmd FileType <filetype> setlocal cindent直接在您的~/.vimrc中,但是一旦您进行了许多自定义设置,这往往会变得笨拙。

关于vim - MacVim 中的第二行被第一行的 tabstop 关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20619819/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com