Skip to content

Latest commit

Β 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

IDE Layer

This layer is an opinionated setup that works nicely with the Vimr and Oni editors for Neovim.

This layer attempts to bring in some common functionality found in most editors. Many people use different editors for different jobs, depending on the language support in the respective editors. While VimR is macOS only, Oni is cross-platform. That said, these bindings have been set up mainly with macOS in mind, but any additions to improve them on Linux and Windows are more than welcome.

Table of Contents

Install

Add the +gui/ide layer in your configuration file,

function! Layers()
  " ...
  Layer '+gui/ide'
  " ...
endfunction

Functionality

GUIs mostly use tabs for the tabline, and as such we will be using tabs a lot, while still making it easy to use buffers inside the tab pages. This will bring a mix of both strengths from modern editors and Neovim. You will want to decide on a case-by-case basis if you want to open a file in a buffer or tab.

  • In CtrlP you can use Ctrl-t to open a file in a tab, else it'll open in the current buffer.
  • In NERDTree you can use t to open the file in a tab, else it'll open in the current buffer.

A recommendation is to open the files you switch back to often in a tab, and open quick one-offs in the current buffer.

Out of the box, Neovim has a horrible setup for a file explorer experience that you find in most editors nowadays. This layer attempts to bring some of this functionality into SpaceNeovim by contorting NERDTree a bit.

An overview of functionality with configuration can be seen here:

ConfigDefaultAutocommand
g:spIdeUseTabs 1 N/A
Set up the keybindings to work on tabs, instead of buffers (such as CMD+n opening a new tab).
g:spIdeOpenNERDTree 1 VimEnter + TabNew
NERDTree will open the file browser on startup, and when opening a new tab (relies on g:spIdeUseTabs = 1), to mimic having a consistent file explorer in the side.
g:spIdeSyncNERDTreeAutomatically 1 BufEnter
Automatically synchronize NERDTree to be the root of the project you are working in.
g:spIdeFindFileNERDTreeAutomatically 1 BufEnter
Automatically locate the currently open file in the NERDTree file tree.
g:spIdeOpenBufferWhenNERDTreeIsLast 0 BufEnter
If NERDTree is the only window left, open a new buffer in a split on the left side.
g:spIdeCloseNERDTreeIfIsLast 0 BufEnter
Close NERDTree if it's the last open window in the tab page, but not the last tab open.
g:spIdeUseTabsInCtrlP 0 N/A
Make CtrlP open files in a new tab, on return and mouse-click.
g:spIdeOniEnableVimCommandPalette 0 N/A
Force enable keybinding of `CMD Shift p` for launching the vim command palette, when using Oni.
g:spIdeOniEnableCtrlP 0 N/A
Force enable keybinding of `CMD p` for launching the CtrlP, when using Oni.

Key Bindings

Key Binding Description
⌘ p Open fuzzy finder (CtrlP)
⌘ ⇧ p Open Vim command palette CtrlPCmdPalette
⌘ s Save file (with :w)
⌘ w Close the current tab/buffer
⌘ q Quit the buffer/window/file (with :q)
⌘ z Undo
⌘ ⇧ z Redo
⌘ n Open new tab/buffer
⌘ f Start searching
⌘ [1-9] Switch to tab/buffer at location n (1 to 9)
⌘ ^ [1-9] Move tab to location n (1 to 9)