Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Tab to go back to "insert" mode #158

Closed
1 of 4 tasks
romainf-unity opened this issue May 14, 2018 · 7 comments
Closed
1 of 4 tasks

Use Tab to go back to "insert" mode #158

romainf-unity opened this issue May 14, 2018 · 7 comments
Labels

Comments

@romainf-unity
Copy link

  • MacVim
  • mvim --version:
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Mar 27 2018 11:10:27)
macOS version

(There's more information, like patches applied, options enabled by default, etc. I can paste it if you're interested)

  • Output of :echo has("python"): 0
  • Output of :echo has("python3"): 1
  • Output of :echo &pythondll(only vim, not neovim): ""
  • Output of :echo &pythonthreedll(only vim, not neovim): ""
  • Output of :py print(sys.version): E319 (command not available)
  • Output of :py3 print(sys.version): 3.6.4 (default, Mar 9 2018, 23:15:03)
    [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)]
  • Operating system:
    • Linux
    • Mac OS X
    • Windows
    • Etc.
  • Configurations related to LeaderF in vimrc: none

Describe your question, feature request, or bug.

It would be nice if it's possible to also press Tab to go back to "insert" mode.

Steps to reproduce

  • <Leader>F
  • Press Tab

Actual behaviour

When pressing Tab it does nothing.

Expected behaviour

When pressing Tab it goes back in "insert" mode (as if I pressed i).

@Yggdroot
Copy link
Owner

You can refer to the below:

LeaderF/doc/leaderf.txt

Lines 429 to 448 in 7eada20

g:Lf_NormalMap *g:Lf_NormalMap*
Use this option to customize the mappings in normal mode.
e.g., >
let g:Lf_NormalMap = {
\ "File": [["<ESC>", ':exec g:Lf_py "fileExplManager.quit()"<CR>'],
\ ["<F6>", ':exec g:Lf_py "fileExplManager.quit()"<CR>']
\ ],
\ "Buffer": [["<ESC>", ':exec g:Lf_py "bufExplManager.quit()"<CR>'],
\ ["<F6>", ':exec g:Lf_py "bufExplManager.quit()"<CR>']
\ ],
\ "Mru": [["<ESC>", ':exec g:Lf_py "mruExplManager.quit()"<CR>']],
\ "Tag": [],
\ "BufTag": [],
\ "Function": [],
\ "Line": [],
\ "History":[],
\ "Help": [],
\ "Self": [],
\ "Colorscheme": []
\}

e.g.,

let g:Lf_NormalMap = { 
         \ "File":   [["<tab>", ':exec g:Lf_py "fileExplManager.input()"<CR>']]
         \ }

@Yggdroot Yggdroot added the FAQ label May 14, 2018
@romainf-unity
Copy link
Author

Thanks, I'll try that locally, but don't you think it would be interesting to make it by default for everyone? It seems simpler (to me) to have one key to swap between modes.

@romainf-unity
Copy link
Author

romainf-unity commented May 15, 2018

I added that in my .vimrc and it feels way more natural to use now:

"" LeaderF
let g:Lf_NormalMap = { 
         \ "File":   [["<ESC>", ':exec g:Lf_py "fileExplManager.quit()"<CR>'],
         \            ["<TAB>", ':exec g:Lf_py "fileExplManager.input()"<CR>']
         \           ],
         \ "Buffer": [["<ESC>", ':exec g:Lf_py "bufExplManager.quit()"<CR>'],
         \            ["<TAB>", ':exec g:Lf_py "bufExplManager.input()"<CR>']
         \           ],
         \ "Mru":    [["<ESC>", ':exec g:Lf_py "mruExplManager.quit()"<CR>'],
         \            ["<TAB>", ':exec g:Lf_py "mruExplManager.input()"<CR>']
         \           ]
         \ }

It would be nice to have that by default IMHO.

Edit: add Buffer and Mru mappings

@Yggdroot
Copy link
Owner

Sorry, I am already accustomed to "i", so I don't plan to change it.

@Yggdroot
Copy link
Owner

I think adding <tab> instead of just replacing "i" is another solution.

@romainf-unity
Copy link
Author

Yep, I also think that adding is better since it doesn't change users habits.

@romainf-unity
Copy link
Author

Just tested on File and Buffer pages, it works super nice, thanks! ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants