【问题标题】:Vim cursor wrapping with .vimrc用 .vimrc 包装 Vim 光标
【发布时间】:2014-03-17 23:11:37
【问题描述】:

我似乎无法让光标环绕在 vim 7.3 中工作。我尝试了其他地方的建议,包括以下内容,但没有效果:

  :set whichwrap+=<,>
  :set whichwrap+=>,l
  :set whichwrap+=<,h

有什么建议吗?我已经包含了我的 .vimrc 以防发生冲突...

syntax on

":set whichwrap+=<,h
set whichwrap+=<,>,[,]

colorscheme koehler
noremap <tab> i
inoremap <Down> <C-o>gj
inoremap <Up> <C-o>gk

nnoremap ; :
nnoremap : ;

set more                      " use more prompt
set autoread                  " watch for file changes
set number                    " line numbers
set noautowrite               " don't automagically write on :next
set lazyredraw                " don't redraw when don't have to
set showmode
set showcmd
set nocompatible              " vim, not vi
set autoindent smartindent    " auto/smart indent
set smarttab                  " tab and backspace are smart
set tabstop=4                 " 6 spaces
set shiftwidth=2
set scrolloff=5               " keep at least 5 lines above/below
set sidescrolloff=5           " keep at least 5 lines left/right
set history=200
set backspace=indent,eol,start
set linebreak
set cmdheight=2               " command line two lines high
set undolevels=1000           " 1000 undos
set updatecount=100           " switch every 100 chars
set complete=.,w,b,u,U,t,i,d  " do lots of scanning on tab completion
set noerrorbells              " No error bells please
set visualbell t_vb=            " and don't make faces
filetype on                   " Enable filetype detection
filetype indent on            " Enable filetype-specific indenting
filetype plugin on            " Enable filetype-specific plugins
set wildmode=longest:full
set wildmenu                  " menu has tab completion
set laststatus=2

set incsearch                 " incremental search
set ignorecase                " search ignoring case
set hlsearch                  " highlight the search
set showmatch                 " show matching bracket
set diffopt=filler,iwhite     " ignore all whitespace and sync

  if v:version >= 700
    " Enable spell check for text files
      autocmd BufNewFile,BufRead *.txt setlocal spell spelllang=en
      endif

      " mappings
      " toggle list mode
      nmap <LocalLeader>tl :set list!<cr>
      " toggle paste mode
     nmap <LocalLeader>pp :set paste!<cr>

【问题讨论】:

    标签: vim word-wrap text-cursor


    【解决方案1】:

    .vimrc 中的以下行是冲突的。注释掉该行可能会解决问题。

    set nocompatible              " vim, not vi
    

    对于自动换行,我建议你使用这个,并使用更多的hl,而不是左右箭头键:

    set whichwrap+=<,>,h,l,[,]
    

    【讨论】:

    • 这不是冲突,而是重置了一些先前设置的选项。如果它位于文件的开头,则不会产生不良影响。
    • 谢谢,这是一些有用的信息。我认为.vimrc 本身的存在使这个选项毫无意义。
    • 我正在努力禁用 lua 中的 whichwrap
    猜你喜欢
    • 1970-01-01
    • 2012-12-07
    • 2023-02-01
    • 2020-09-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-07-08
    • 1970-01-01
    相关资源
    最近更新 更多