5

What you are creating with the maps commands are mappings (:h key-mapping) which are used to change the meaning of typed keys. Very concretely what you command does is to say to Vim "When I type the keys <LocalLeader> followed by shift+e then consider that I actually pressed the following keys: :call HOLSelectTactic()<CR>-Vo+ So let's take ...


4

Use append() function instead as described in :h setline() help section. It accepts the line number and and either a text line or a list of text lines that would be inserted/appended after given line number. func! AddCommentHeader(lnum) abort let comment_header = \[ \'//*****************************************************...


3

You can invert a boolean with !: let foo = 1 echo foo " will print 1 let foo = !foo echo foo " will print 0 I'm afraid I can't help much with the overall function as I am unfamiliar with minimap, but that might help you get started. Note that the syntax in your ternary operatory is incorrect. If you are doing it that way you want: let foo = foo =...


3

ALE's readme says ALE offers support for fixing code with command line tools in a non-blocking manner with the :ALEFix feature so ALEFix is asynchronous and your yanking commands would need to wait for it to complete before they run. If you look further in the Readme in the FAQ there is How can I execute some code when ALE starts or stops linting? The ...


3

As Matt said, it should be {e: len(e)}. Also, for efficiency with vimscript language, you should prefer map(), but this will introduce a new parameter in the oper function call map(copy(a:array), {_, e -> extend(a:accumInit, {e: len(e)})}) return a:accumInit It could be encapsulated in your namespace#reduce() function though: call map(copy(a:array), {_, ...


3

In the newest Vim version (not in Neovim yet) reduce() is a builtin. Dictionary in VimScript can only have String keys (cf. AWK). For this reason, [key]: value notation is not even supported. Obviously, if all items are strings anyway then you can have {el: len(el)}. Otherwise {string(el): len(el)} might also work for you. But, chances are, you need to re-...


3

The problem is this line: normal <ESC> If :normal worked how you think it does, then it would immediately leave visual mode that you just entered with your previous line (so the fix is just to remove that line). However, what that command actually does is emulate you typing: <ESC>, and the S command is what garbles your line, deleting the current ...


2

There are a few tricky bits here so lets break this down into components. search(a:l,"Wbc") This will search for the pattern backwards (b flag). It uses the W to prevent wrapping around the file and c to accept a search at the current position. This will in affect find the beginning of the pattern and move the cursor there. e.g. Theorem in this ...


2

You have several ways to do it: You can use <bar> which is the key code for | to be used in a mapping (Do not use | directly in your mapping): nnoremap <leader>a :echo "fizz" <bar> echo "buzz"<CR> This is the equivalent of running :echo "fizz" | echo "buzz" in the command line. You can also ...


1

After some try-and-errors I resolved this problem. Btw, if I add to it, would the never be triggered? Yes. Change nnoremap <C-W> <NULL> to: nnoremap <C-W> <ESC> Since normally no key will follow <ESC>. (Remember when you were a newbie and wanted to escape from it) Result, done in 1 second:


1

See :h func-closure to declare inner function as closure. For an example of g@ implementation using closures you can look into my plugin source code: vim-opera.


1

You can pass a command when starting up with -c (or +): vim -c 'PlugUpdate' You may also want to pass qall if you are running this from a script.


1

Knowing from :help ale-python-pylint that we want to adjust g:ale_python_pylint_options to include --rcfile, I would drop let g:ale_python_pylint_options = '--rcfile '.<filename> in wherever the right place is for you. That could be wherever you configure ALE, if a single setting is right; or, it could be in an ftplugin (use b:…) if you need to change ...


1

The logic is wrong here: getline('.')[col - 1] =~# '{' This is saying anywhere before my cursor do I have a { character. Probably want something that says does the end have a { character getline('.')[col - 1] =~# '{$' getline('.')[col - 1] == '{' Although in theory that could still be weird if you put your insert cursor between {} characters and hit <...


1

After some search this work(, but might be simplified further): " My try inoremap <silent><expr> <CR> \ <SID>if_open_curly_on_left()? "\<CR>}\<ESC>O": \ "\<CR>" function! s:if_open_curly_on_left() abort let col = col('.') - 1 return getline('.')[col - 1] == '{' endfunction


1

The question is invalid. Maybe XY problem or something. If &indentexpr is set to some function then that function calculates on-the-fly the number of spaces to indent a line. If also &expandtab is not set then Vim is allowed to minimize that number by outputting tabs - one hard tab per &tabstop spaces. But if you set expandtab then you say: "...


1

A slightly neater looking alias: alias vimprivate='vim -u NONE -c "setlocal history=0 nobackup nomodeline noshelltemp noswapfile noundofile nowritebackup secure viminfo=\"\""'


Only top voted, non community-wiki answers of a minimum length are eligible