如何解决无法看到文件中的前两个字符
Vim 详细信息:
$ vim --version
VIM - Vi IMproved 8.1 (2018 May 18,compiled Jun 5 2020 21:30:37)
macOS version
在这里您可以看到文件开头的 package v1
字没有正确显示。
这只发生在 .go
文件,vimrc 文件如下,
Syntax on
colo gruvBox
" Flash screen instead of beep sound
set visualbell
" Change how vim represents characters on the screen
set encoding=utf-8
" Set the encoding of files written
set fileencoding=utf-8
" Show tabs set 0 if donot want tabs
set showtabline=2
autocmd Filetype python setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4
autocmd Filetype go setlocal tabstop=4 shiftwidth=4 softtabstop=4
" ts - show existing tab with 4 spaces width
" sw - when indenting with '>',use 4 spaces width
" sts - control <tab> and <bs> keys to match tabstop
" Control all other files
set shiftwidth=4
set undofile " Maintain undo history between sessions
set undodir=~/.vim/undodir
" Hardcore mode,disable arrow keys.
noremap <Up> <nop>
noremap <Down> <nop>
noremap <Left> <nop>
noremap <Right> <nop>
filetype plugin indent on
set backspace=indent,eol,start
" go-vim plugin specific commands
" Also run `goimports` on your current file on every save
" Might be be slow on large codebases,if so,just comment it out
let g:go_fmt_command = "goimports"
" Status line types/signatures.
let g:go_auto_type_info = 1
au filetype go inoremap <buffer> . .<C-x><C-o>
" If you want to disable gofmt on save
" let g:go_fmt_autosave = 0
"
" NERDTree plugin specific commands
":nnoremap <C-g> :NERDTreetoggle<CR>
"autocmd vimenter * NERDTree
"let NERDTreeMapOpenInTab='<ENTER>'
" air-line plugin specific commands
let g:airline_powerline_fonts = 1
let g:airline_theme='angr'
let g:airline#extensions#tabline#enabled = 1
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
" unicode symbols
let g:airline_symbols.whitespace = 'Ξ'
let g:airline_symbols.branch = ''
let g:airline_symbols.readonly = ''
当我在 package v1
上使用视觉模式时
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。