Giter VIP home page Giter VIP logo

intellimacs's Introduction

Intellimacs

https://cdn.rawgit.com/syl20bnr/spacemacs/442d025779da2f62fc86c2082703697714db6514/assets/spacemacs-badge.svg

docs/preview.gif

Presentation

This project tries to mimic Spacemacs key bindings in IDEs based on the IntelliJ platform, i.e. IntelliJ IDEA, PyCharm, CLion, PhpStorm, WebStorm, RubyMine, AppCode, DataGrip, GoLand, Rider, Cursive, and Android Studio.

For instance, SPC f f in Spacemacs opens a file, so it makes sense to map it to the “GotoFile” IntelliJ action.

How it works

This project can be seen as a set of configuration files for the IdeaVim plugin, which enables vim emulation inside IntelliJ platform. ~/.ideavimrc is the file where IdeaVim lets you add Vim initialization commands, i.e. this file is like ~/.vimrc for vim.

IdeaVim parses the most common vim commands, together with the custom :action {name} command, used to execute arbitrary IDE actions. To list all IDE actions use the command :actionlist [pattern].

Intellimacs provides different files, which can be included individually in your own .ideavimrc, in order to get only the functionalities you want.

Key bindings

Intellimacs is composed of three modules:

spacemacs
Contains Spacemacs settings and key bindings that can be replicated with a similar behaviour in the IntelliJ platform.
extra
Contains settings and key bindings not present in Spacemacs, but that may be useful in the IntelliJ platform.
major
Contains key bindings that start with SPC m, that may or may not be present in some Spacemacs major mode.

Furthermore, Intellimacs provides some of the features of Spacemacs hybrid mode, which may be enabled by sourcing the file ~/.intellimacs/hybrid.vim.

Read KEYBINDINGS.org to see all 200+ available key bindings.

Installation

  1. Go to the IDE’s plugin manager (File -> Settings -> Plugins) and install the following plugins:
    • IdeaVim: vim emulation
    • (Optional) Which-Key: menu that shows the available commands as you type
  2. Clone this repository in your home directory:
    git clone https://github.com/MarcoIeni/intellimacs ~/.intellimacs
        
  3. In your home directory, create the file .ideavimrc and edit it in order to include the modules you want by sourcing the relative source files. In the following there is an example of .ideavimrc file that includes all the functionalities offered by Intellimacs. In this file you can also include your own vim commands.
    source ~/.intellimacs/spacemacs.vim
    
    " (Optional) Enable other Intellimacs modules
    source ~/.intellimacs/extra.vim
    source ~/.intellimacs/major.vim
    source ~/.intellimacs/hybrid.vim
    
    " (Optional) Enable which-key plugin
    source ~/.intellimacs/which-key.vim
    
    " (Optional) My own vim commands
    nnoremap Y y$
    
    " (Optional) Comma for major mode
    nmap , <leader>m
    vmap , <leader>m
    
    " (Optional) Add/edit actions
    nnoremap <leader>gl    :action Vcs.Show.Log<CR>
    vnoremap <leader>gl    :action Vcs.Show.Log<CR>
        
  4. (optional) source your vimrc file by adding the line source ~/.vimrc in .ideavimrc (you may break something).

Update

In order to update run git pull inside the intellimacs directory.

Read CHANGELOG.org to see what changed.

Suggested plugins

PLUGINS.org contains a list of useful plugins that help to replicate the Spacemacs experience.

Tips

Go back to code

The key bindings work only when you are inside the code. For example, if you are inside the project window they don’t work. Press <Esc> to focus the last visited code window and you will be able to use spacemacs key bindings again.

Scroll menus without arrow keys

In order to scroll menus without using arrow keys, press SPC f e d to go to IDE’s settings and set a custom shortcut for the actions Down and Up in the menu Keymap -> Editor Actions. For example, you can bind them respectively to Ctrl + j and Ctrl + k. If you have some conflicts, search the editor action the key is assigned to, right click and remove the binding.

Open a file in Emacs with keyboard shortcut

In order to open a file in Emacs with a keyboard shortcut follow this guide.

Resources

Contributions

Intellimacs needs you to keep it up to date and propose great and useful key bindings.

Before contributing, be sure to read CONTRIBUTING.org first!

Related projects

  • Spaceclipse - Spacemacs’ like key bindings for Eclipse
  • SpaceVim - A community-driven modular vim distribution
  • VSpaceCode - Spacemacs’ like key bindings for Visual Studio Code (thanks for the inspiration)

Related projects (No Spacemacs keys)

  • Glimpse - Mnemonic key bindings for VSCode commands

intellimacs's People

Contributors

alexpl292 avatar floaterest avatar mangosmoothie avatar marcoieni avatar nimamoh avatar sniperwolf avatar sweetliquid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

intellimacs's Issues

not showing 'space + tab' last-buffer keybinding in which-key

Hi, Thanks a lot for creating intellimacs. It had made life so easy on IntelliJ Idea and Android Studio as an emacs user.
This is a nit pick. The space + tab keybinding, where space is leader key, does not appear in which-key. That is not an issue. The issue is that when I press space + tab fast, it does move focus to last-buffer, though which-key keeps showing at the bottom of the frame. It does not happen with other keybindings. This is a nit pick as it only makes me pause a bit while moving to last-buffer which I do a lot, but not a functional issue.
My config: MacBook with M1 chip
Please feel free to close the issue if there is no simple quick-fix.
Thanks!

In visual mode selection is automatically yanked

  1. Install IDEA Community Edition.
  2. Install Intellimacs as described in README.md.
  3. Use this .ideavimrc (the issue can be reproduced with the default one, but the rest doesn't make a difference):
    source ~/.intellimacs/spacemacs.vim
    
  4. Open a file (I have checked this for Scala and BUILD files).
  5. Select some text (e. g. V, j, j, j), and press Esc to return to normal mode.
  6. Paste (p).
  7. See that the previously selected text is pasted, even though it was not yanked by the user!

This is annoying when attempting to replace one piece of text with another. Usually I do it like this:

  1. Select and yank the first region.
  2. Select the second region.
  3. Paste.

This no longer works, since on step 2 I lose the yanked data.

This seems to be an Intellimacs bug because with empty .ideavimrc selection works as expected.

'Space' + 'number' focuses the respective window

When opening multiple windows, it would be helpful to be able to focus them via keybinds similar to spacemacs. Space + 1 should focus the first window, Space + 2 should focus the second window, Space + 0 should focus the file tree browser, etc

Help

hay I'm trying to get this to work on Rider on windows i have wsl installed but my ideavimrc is located on my windows partition what do i need to change to make this work

no popup?

Hi,
IntelliJ IDEA 2021.2.2-1 (Community Edition)
It's work,But no popup anything?I can use shortcut,but no popup?

Alternative installation method

Hey, thanks for working on this. It's looking great :)

I was wondering if you could provide a different method of installing the vim configs in future versions. I'm switching between different machines quite frequently and therefore have to keep my .ideavimrc file in sync. That's why it would be awesome to be able to have one big file that I can just add to the end of my .ideavimrc file or something like that. Bundling this as a plugin that can just be installed from within the IDE would of course be the best way, but that's probably not really feasible, is it?

Anyways, keep up the great work 👍

How do you remember all the keys?

In Spacemacs, pressing <leader> X leads to a small tooltip window popping up and showing you what keys you might be able to press and what they might do. Is there such a thing here?

P.s do you know how this works (if at all) with KeyPromoterX?

BTW, Thanks for the awesome job on this! Having 1 set of efficient keybindings across my editor was something I sorely missed when I moved away from Spacemacs (now using Clion, Pycharm and IntelliJ)

Dinamically show key bindings: which-key implementation

Introduction

I don't have experience with IntelliJ plugin development, so I would like to discuss with you if it is possible to implement something like which-key:

2019-12-29_1759x167

That is, when you press a key, all the possible key bindings are showed.

In order to implement this, a which-key IntelliJ plugin should be developed.

Which-key plugin requirements

This plugin should be able to do the following things:

Know <key bindings, action> pairs

The plugin shall be able to read all the key bindings and the associated actions defined by intellimacs.

I think that it can do it in two ways:

  • by calling some IdeaVim API (I don't know if there are some).
    • Does IdeaVim exposes some APIs in order to know the key bindings defined by the user?
  • by analyzing the *.vim files.
    • Is there a *.vim kotlin/java parser library?

Read the keys pressed by the user

The plugin shall be able to read the keyboard input in order to dinamically show available key bindings.

  • if the which-key reads the keys pressed by the user, will ideavim execute the action when the action is completed? I.e. the keyboard is sent in broadcast to all plugins and each plugin manage it independently or only one plugin can read user input?

If which-key plugin doesn't interfere with IdeaVim, it only has to show the action names.

Assign which-key names to all key bindings

We are working on the branch which-key in order to add which-key support to intellimacs.
We have to assign to each key binding the name to be showed in idea-which-key.

You can see the current status of the work in PR #15. This PR is automatically updated once PR against the which-key branch are merged.
In order to contribute, leave a comment to tell on which module you want to work and then open a PR against the which-key branch where you add the name of the key bindings. For an example, see #16.
As you can see from the examples, modules can be both under spacemacs and extra.

updated modules:

  • applications.vim
  • bookmarks.vim
  • buffers.vim
  • colors.vim
  • compile-comments.vim
  • errors.vim
  • files.vim
  • frame.vim
  • git-vcs.vim
  • help.vim
  • help-history.vim
  • insertion.vim
  • jump.vim
  • jump-join-split.vim
  • leader.vim
  • major mode
  • misc.vim
  • narrow-numbers.vim
  • projects.vim
  • quit.vim
  • registers-rings-resume.vim
  • run.vim
  • search.vim
  • search-symbol.vim
  • text.vim
  • toggles.vim
  • ui_toogles-themes.vim
  • windows.vim
  • zoom.vim

If you want to try this follow the instructions of the readme of #15 and do:

cd ~/.intellimacs
git pull
git checkout which-key

P.s. you don't need to be an expert to contribute, you can also edit a file from your browser. Just make sure you are in the which-key branch.

Glimpse for intellij?

I saw your new project "Glimpse" for vs code. Are you planning to create one for intellij as well? I like the "why"(your reasoning behind glimpse). Do you think it makes sense to shortcut sequences for intellij as well?
And I also have a question regarding uppercase letters that you use in the sequences... Generally uppercase letters are harder to type compared to lowercase, because they require holding or tapping shift key. E.g. lazygit uses uppercase keys for commands that are a more dangerous or could cause a negative effect(like git push). Do you try to do the same? I think often used commands should consist of lowercase letters... What do you think about it? I know that main point of these sequences is mnemonics and not necessarily speed, because speed will come over time, but still uppercase is extra effort compared to lowercase.

The shortcut to open a new terminal/shell opens a new terminal every time.

Observed behavior
Pressing the key combination SPC -> ' to open a terminal causes a new terminal to be opened everytime.

Desired behavior
Should reuse the last open terminal.

Proposed solution:
Change SPC -> ' from executing the ideavim action Terminal.OpenInTerminal to instead executing ideavim action ActivateTerminalToolWindow

[Request] Structural editing

Hello! I'm really enjoying this project and depend on it for all my kotlin dev. However, I am increasingly missing the structural editing slurp and barf keys from spacemacs.

I was looking around the intellij plugin ecosystem and it looks like the Cursive is the best bet there -- but structural editing is just a small part of that plugin being for clojure language support, which seems like more than I want. And I'm not sure how to map the keys to my preferred spacemacs bindings.

Is there any chance of this possibly eventually making it into intellimacs, or is that beyond the scope of this project? Thanks!

relative path is not working?

hi first of all, thanks for the shortcuts. As a spacemacs lover, I really like the idea of using that in intellij.

Anyways, I have been trying to make it work and could not make it recognize the bindings. After a lot of trial and error, it seems that switching imports like:

source ./intelli-space/spacemacs/settings.vim

to

source ~/intelli-space/spacemacs/settings.vim

fixed my issue. I'm not sure if this a problem with my own setup, but I think it is pretty vanilla, so I'm not sure if this is a general fix or if it is only for me

whichkey in android-studio

Which Key descriptions aren't showing up in android-studio

the only things I have enabled in .ideavimrc are spacemacs and which-key

"SPC w S" and "SPC w V" do not work anymore

All the actions prefixed with VimWindow do not work anymore.
I fixed almost all the actions under SPC w by replacing VimWindow actions with vim keys, for example VimWindowDown was replaced with <C-w>j.

The problem is with SPC w S and SPC w V.

https://github.com/MarcoIeni/intelli-space/blob/c0e2853a9526c202fe84cb29628cac3ff5dcc2f4/spacemacs/windows.vim#L51-L57

When I replace them with the following code it doesn't work.

" Split window below and focus
nnoremap <leader>wS    :action SplitHorizontally<CR><C-w>j
vnoremap <leader>wS    <Esc>:action SplitHorizontally<CR><C-w>j

" Split window right and focus
nnoremap <leader>wV    :action SplitVertically<CR><C-w>l
vnoremap <leader>wV    <Esc>:action SplitVertically<CR><C-w>l

[Request] use `EditorCodeBlockStartWithSelection` when in visual mode over `EditorCodeBlockStart`

Hi there, firstly thank you for making this plugin it's amazing. I'm extremely new to Jetbrains and specifically Rubymine. I'm trying it out after being on Spacemacs for some years and just got tired of its endless struggles.

As I learn the keybindings and how to do remappings and navigation and such, I thought I might suggest that we change the visual mode remap when using spc + ] and spc +[ to EditorCodeBlockEndWithSelection and its start equivalent. This seems to map more closely with at least my configuration in spacemacs which I think is quite standard, that when in visual mode and jumping to matching braces, visual highlights the selection.

Your thoughts?

" Go to code block start with selection
" (I'm not sure what this line will do so I've left it commented out) let g:WhichKeyDesc_Leader_GotoCodeBlockStartSelection = "<leader>[ goto-code-block-start with selection"
vnoremap <leader>[    <Esc>:action EditorCodeBlockStartWithSelection<CR>

" Go to code block end with selection
" (I'm not sure what this line will do so I've left it commented out) let g:WhichKeyDesc_Leader_GotoCodeBlockEndSelection = "<leader>] goto-code-block-end with selection"
vnoremap <leader>]    <Esc>:action EditorCodeBlockEndWithSelection<CR>

How did you find the `:action X`?

Hey there!

I know you're not working on this any longer, so apologies for bothering you. I'm just curious as the

nnoremap <leader>mgi    :action GotoImplementation<CR>
vnoremap <leader>mgi    <Esc>:action GotoImplementation<CR>

I'm trying to create custom bindings and I'm having issues. Thank you!

Comma for major mode

Hi,
i got used to comma to access major mode key bindings. I saw no other way just to copy your files and hardcode it.

The question, do you know any other convinient methods to do so? I am not a vim specialist. Or i can write a script which generate additional package based on major mode files provided.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.