I have one question.
I updated vim version from 7.4 to 8.0.
"set expandtab" does not take effect in .vimrc.
Please tell me how to enable "set expandtab" in .vimrc.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
rosso@ubuntu:~$ vim --version
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Sep 15 2016 15:47:24)
Included patches: 1-5
Modified by pkg-vim-m...@lists.alioth.debian.org
Compiled by pkg-vim-m...@lists.alioth.debian.org
Huge version without GUI. Features included (+) or not (-):
+acl +file_in_path +mouse_sgr +tag_old_static
+arabic +find_in_path -mouse_sysmouse -tag_any_white
+autocmd +float +mouse_urxvt -tcl
-balloon_eval +folding +mouse_xterm +termguicolors
-browse -footer +multi_byte +terminfo
++builtin_terms +fork() +multi_lang +termresponse
+byte_offset +gettext -mzscheme +textobjects
+channel -hangul_input +netbeans_intg +timers
+cindent +iconv +num64 +title
-clientserver +insert_expand +packages -toolbar
-clipboard +job +path_extra +user_commands
+cmdline_compl +jumplist -perl +vertsplit
+cmdline_hist +keymap +persistent_undo +virtualedit
+cmdline_info +lambda +postscript +visual
+comments +langmap +printer +visualextra
+conceal +libcall +profile +viminfo
+cryptv +linebreak -python +vreplace
+cscope +lispindent -python3 +wildignore
+cursorbind +listcmds +quickfix +wildmenu
+cursorshape +localmap +reltime +windows
+dialog_con -lua +rightleft +writebackup
+diff +menu -ruby -X11
+digraphs +mksession +scrollbind -xfontset
-dnd +modify_fname +signs -xim
-ebcdic +mouse +smartindent -xpm
+emacs_tags -mouseshape +startuptime -xsmp
+eval +mouse_dec +statusline -xterm_clipboard
+ex_extra +mouse_gpm -sun_workshop -xterm_save
+extra_search -mouse_jsbterm +syntax
+farsi +mouse_netterm +tag_binary
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -o vim -lm -ltinfo -lnsl -lselinux -lacl -lattr -lgpm -ldl
Does it occur on all filetypes?
You can use :verbose set expandtab? to check which script sets the option.
Thank you for the advice.
Does it occur on all filetypes?
Yes. This occurs in all of the files.
The result of :verbose set expandtab? is as following.
noexpandtab
Last set from ~/.vimrc
Hi
Are you sure, you don't have it later disabled in your .vimrc?
This is my .vimrc.
(Sorry some Japanese word include...)
I also removed all vim plugin, but this still occured.
" ---------------------------- 表示設定関連 -----------------------------------
colo desert
set paste
syntax on
" タブを半角スペース4つに設定
set tabstop=4
" タブを半角スペースに変更
set expandtab
" インデントの幅を半角スペース4つに設定
set shiftwidth=4
" 折り返し禁止
set nowrap
" line numberを表示
set number
" カーソルラインを強調
set cursorline
" 縦線の設定
set colorcolumn=80
" タイトルを表示
set title
" ルーラーを表示
set ruler
" ステータス行を設定
set laststatus=2
set statusline=%f%m%=%l,%c\ %{'['.(&fenc!=''?&fenc:&enc).']\ ['.&fileformat.']'}
" 不可視文字を可視化
set list
set listchars=tab:>-,nbsp:・,trail:・
"全角スペースを で表示
highlight JpSpace cterm=underline ctermfg=Yellow guifg=Yellow
au BufRead,BufNew * match JpSpace / /
" タブにフルパスでなく、ファイル名のみを表示する
set tabline=%!MyTabLine()
function! MyTabLine()
let s = ''
for i in range(tabpagenr('$'))
" 強調表示グループの選択
if i + 1 == tabpagenr()
let s .= '%#TabLineSel#'
else
let s .= '%#TabLine#'
endif
" タブページ番号の設定 (マウスクリック用)
let s .= '%' . (i + 1) . 'T'
" ラベルは MyTabLabel() で作成する
let s .= ' %{MyTabLabel(' . (i + 1) . ')} '
endfor
" 最後のタブページの後は TabLineFill で埋め、タブページ番号をリセットする
let s .= '%#TabLineFill#%T'
return s
endfunction
function! MyTabLabel(n)
let buflist = tabpagebuflist(a:n)
let winnr = tabpagewinnr(a:n)
return fnamemodify(bufname(buflist[winnr - 1]), ":t")
endfunction
let &t_ti .= "\e[1 q" " 端末を termcap モードにする
let &t_SI .= "\e[5 q" " 挿入モード開始(バー型のカーソル
let &t_EI .= "\e[1 q" " 挿入モード終了(ブロック型カーソル)
let &t_te .= "\e[0 q" " termcap モードから抜ける
" ---------------------------- 検索関連 ---------------------------------------
" 大文字と小文字を区別しない
set ignorecase
" 大文字と小文字が混在した言葉で検索を行った場合に限り、大文字と小文字を区別する
set smartcase
" インクリメンタルサーチ
set incsearch
" 検索文字列をハイライトする
set hlsearch
" 循環検索しない
set nowrapscan
" ---------------------------- 便利機能 ---------------------------------------
" helpをword上で<Shift>kで開くようにする
set keywordprg=:help
" ---------------------------- ショートカットキーの設定 -----------------------
" 別タブを開いてタグジャンプ
nnoremap <F1> :NERDTreeToggle<CR>
nnoremap <F3> :<C-u>tab stj <C-R>=expand('<cword>')<CR><CR>
nnoremap <Tab> :<C-u>stj /<C-R>=expand('<cword>')<CR><CR> <C-w><S-j>
nnoremap <C-j> :sp<CR> /<C-R>=expand('<cword>')<CR><CR> <C-w><S-j><CR>
nnoremap <C-l> :vs<CR> /<C-R>=expand('<cword>')<CR><CR> <C-w><S-l><CR>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.![]()
—
You are receiving this because you commented.
Hi
I removed "set paste" then this problem resolved!
Thank you!
But why?
—
You are receiving this because you commented.
The whole point of set paste is to disable things like mappings, wordwrap, indenting, etc. (and prevents, that a tab is replaced by the equivalent number of spaces). That is a setting that shouldn't be set in your .vimrc, only temporarily. You might want to read up the help on it :h 'paste', :h 'pastetoggle' and similar. If you have further questions, please ask on the appropriate forums, like the vim-use ml or vi.stackexchange.com
—
You are receiving this because you commented.
OK.
I understood.
Thank you.
—
You are receiving this because you commented.