Sometimes vim's smartindent does not pick the correct level of indentation for the next line once you hit enter and you'd like to go back to the indentation level of the previous line and just go from there. I know that you can hit ctrl-d
a few times to achieve this but it would be more useful for a key that immediately goes to the indentation level of the line above.
Just download it, activate it within Excel (the simple steps will be described after you click the download button) and type this formula: Let’s say you want to get the indent level of cell A1, just type =PROFEXIndentLevel (A1). Press F9 for refreshing. This function is included in our Excel Add-In 'Professor Excel Tools'
You cannot define indents for a numbered/bulleted style through Modify Style | Format| Paragraph , and Modify Style | Format | Numbering has no indent settings. You have to go through Define New Multilevel List to link the style to the selected numbering/indents.
In normal mode, the Backspace acts as h, it just goes to the left. By default, the backspace will go to the previous line if at the start of a line (as if eol was in backspace ); you can control this behaviour with the 'whichwrap' option through the b flag (enabled by default).
With these mappings, in normal mode, press Alt-, to find the previous line with the same indent as the current line, or press Alt-. to find the next such line. These mappings should work in gvim, but you may need to choose different keys if working with Vim in a terminal.
I don't know if it's pure coincidence, but Alexey Radev has just published the prev_indent plugin, which provides an insert mode mapping and :PrevIndent
command to move the current line to the previous indentation level.
If you can't be bothered to install a plugin for such a simple task (I couldn't), try this simple mapping:
:inoremap <C-D> <Esc>:call setline(".",substitute(getline(line(".")),'^\s*',matchstr(getline(line(".")-1),'^\s*'),''))<CR>I
Now CtrlD in insert mode will do the deed: indent the current line like the previous line.
This works best before you start typing on the new line, because it will reset the cursor to just past the indentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With