Comments (6)
This is a duplicate of #45
from vintage.
This is not the default in Vim. I had these lines in my .vimrc in order to get MacVim to behave this way on FocusLost:
" Return to normal mode on FocustLost
au FocusLost * call feedkeys("\<C-\>\<C-n>")
As a long time vim user, I really missed this behavior in ST2+Vintage (just like you) so I coded a small plugin to always return to command mode after switching tabs or windows:
import sublime, sublime_plugin
class ReturnToVintageCommandModeListener(sublime_plugin.EventListener):
def on_activated(self, view):
if view.settings().get("is_widget") is None:
view.run_command('exit_insert_mode')
This solves your problem.
Maybe somebody could merge this in Vintage adding an option like that?
EDIT: The snippet code has been updated in order to ignore widget windows (https://gist.github.com/3818550)
from vintage.
@andersonfreitas: That's a great plugin. I think a better default behavior would be to only exit insert mode when switching focus to a different file within a single sublime window. That way you could quickly CMD+Tab to a different program like a web browser to quickly reference something as you're typing without leaving insert mode. However, I don't see anything of the sort in the current version of the vintage API documentation: http://www.sublimetext.com/docs/2/api_reference.html
from vintage.
@andersonfreitas: Also - did you notice that the plugin you created causes the CMD+t window to start in normal mode - that's surely not what we'd want here. Do you know a way to avoid it in that case only?
from vintage.
@jordow Yeah, I've noticed it right after posting this snippet here. There's a slightly modified version that works properly with ⌘+t
: https://gist.github.com/3818550
from vintage.
@andersonfreitas: That's working well. That would be great as an addition to Vintage (configurable, of course) or a standalone plugin installable through PackageControl.
I'll let you know if I see any issues with it.
from vintage.
Related Issues (20)
- Vintage mode for toggle foldong? 'za' HOT 3
- Down-arrow doesn't move cursor to next line while in command mode
- Command mode for non-latin keyboard layout
- Shortcut to enable/disable Vintage HOT 1
- gD not works well in vintage? HOT 1
- Ctrl key does not work
- Key Repeat in Vintage mode not working (OS X 10.11) HOT 1
- I forked this repo to @SublimeText, move/open you issues and pull requests there
- Esc in sublime find mode goes into vintage command mode but closing find panel expected HOT 2
- 🤝
- VIM ‘V + kkkkkkkkk…’ or ‘V + jjjjjjjjjjjjjjjjjjjj…’ makes the scroll crazy HOT 3
- Key strokes are delayed HOT 1
- [BUG] Repeated macro with copy paste
- Brackets & Curly braces (Change, Find, Delete, To) not working
- "T" command in vintage mode does not accept a number argument HOT 3
- gi vim command ?
- v/V commands broken on last line
- same key with different mappings in insert/command/visual modes
- % behavior broken in visual mode
- Large repeat crashes Vintage
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vintage.