New answers tagged

0

One way to do it is to use "fake" indentexpr value: set indentexpr=-1 Having this applied to a filetype (or a buffer without filetype) will make == and friends (gg=G, =ip, etc) never change existing indentation. I had similar problem with a mappings that move lines/selection up and down reindenting after each move (like if a line ends up in an if ...


1

This is a misuse of = operator. Actually, Vim has two builtin "formatting" operators, i.e. = and gq (there's also gw that is simply the same as "internal" gq-formatter). = is supposed for use with programming languages. Of course, it could be set up to do anything you like, but it defaults to C. Does it come as surprise? I don't think so. ...


0

Here is one option, first find your file type by typing :set filetype? within your Vim opened file. Suppose it spits out css, then in your .vimrc file, add the line autocmd FileType css setlocal indentexpr=


0

Within your .vimrc file, add the line autocmd FileType plaintex,tex,context setlocal indentexpr= where autocmd automatically applies the setup when criterion is met FileType is the criterion to be met (for files of certain type) plaintex,tex,context are the common filetypes recognized by vim (see Vim documentation) setlocal indentexpr= sets the required ...


0

I had this just recently and my solution was different. My vim setup was: :set --- Options --- background=dark history=200 langnoremap nomodeline ruler scrolloff=5 ttimeout ttyfast wildmenu display=truncate incsearch nolangremap nrformats=bin,hex scroll=37 ...


Top 50 recent answers are included