.rb
さまざまなバッファーと素晴らしい vim プラグインCtrlpを使用して、いくつかのファイルを喜んで編集 していました。ただし、特定のファイルを再度開いたとき、特にmicropost.rb
すべての自動インデントと構文の強調表示が機能しません。
.micropost.rb.swp
私はそれを開く前にVimに delete 、つまり対応するスワップファイルを削除させたという事実と関係があると確信しています。そして、スワップファイルからのある種の残り物があること。
今、私が1)ファイルをバックアップしたとしても、2)micropost.rb
最初から書きます。.rb
ファイルの検出は行われません。
ただし、同じコードを新しいファイルに書き始めると、たとえばpicopost.rb
、すべてが期待どおりに機能することに注意してください。
EDIT 1、これは私のもの.vimrc
です:
execute pathogen#infect()
set runtimepath^=~/.vim/bundle/ctrlp.vim
syntax on
filetype plugin indent on
set number
"" ADD A line to diferently indented blocks of code
set list lcs=tab:\|\
let mapleader=","
" Fast saving
nmap <leader>w :w!<cr>
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Text, tab and indent related
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Use spaces instead of tabs
"set expandtab
" Be smart when using tabs ;)
set smarttab
" 1 tab == 4 spaces
set shiftwidth=4
set tabstop=4
" Linebreak on 500 characters
set lbr
set tw=500
set ai "Auto indent
set si "Smart indent
set wrap "Wrap lines
" a combination of spaces and tabs are used to simulate tab stops at a width
" other than the (hard)tabstop
set softtabstop=4
""CTRLP mappings
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
"folding settings
set foldmethod=indent "fold based on indent
set foldnestmax=10 "deepest fold is 10 levels
set nofoldenable "dont fold by default
set foldlevel=1 "this is just what i use
hi Folded ctermbg=darkgrey
"Autosave folding state at quit
au BufWinLeave * mkview
au BufWinEnter * silent loadview
""""""""""""""""""""""""""""""
" => Status line
""""""""""""""""""""""""""""""
" Always show the status line
set laststatus=2
" Format the status line
"set statusline=\ %F%m%r%h\ %w\ \ CWD:\ %r%{getcwd()}%h\ \ \ Line:\ %l
"set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{getcwd()}%h\ \ \ Line:\ %l
"
"Splits configuration
set splitbelow
set splitright
"Max out the height of the current split ------ ctrl + w _
"Max out the width of the current split------ ctrl + w |
"Normalize all split sizes, which is very handy when resizing terminal-------- ctrl + w =
"Swap top/bottom or left/right split ------ Ctrl+W R
"Break out current window into a new tabview ---------- Ctrl+W T
"Close every window in the current tabview but the current one ------- Ctrl+W o