Giter Site home page Giter Site logo

vim-ctrlspace's Introduction

Vim-CtrlSpace

Welcome to the Vim-CtrlSpace plug-in for managing

  • your tabs, buffers, files,
  • workspaces (sessions),
  • bookmarks for your favorite projects

including fuzzy search (powered by Go); reachable by the default mapping Ctrl + Space: Pressing <C-Space> opens a window listing

  • Buffers,
  • Files,
  • Tabs,
  • Workspaces, or
  • Bookmarks

selectable by the j, k, and <CR> keys.

Vim-CtrlSpace

Table of Contents

If you have already starred this repo, thank you! If you have a question, a feature request, or a new idea, then don't hesitate to post new issues or pull requests: Collaboration is the most awesome thing in the open source community!

Idea by Analogy

These Lists can be explained with a simple analogy: Imagine Vim is a writing desk.

  • The Bookmarks List lists your favorite projects that are like drawers.
  • To look up the documents in a drawer you need the File List.
  • Once you locate and pick up a file it becomes a buffer. A buffer is like a sheet of paper lying on the desk. Sometimes you can have a blank piece of paper --- that's a new unsaved buffer. Eventually, once saved (put into a drawer), it becomes a file. The Buffer List lets you manage all papers on the desk.

The strongest point of Vim-CtrlSpace is its handling of Tab pages: Each tab holds a separate list of buffers; like a pile of documents on the desk. With tabs you can, for example:

  • group related buffers
  • extract to other tabs
  • name them accordingly
  • move or copy them

Tabs can be accessed and managed within Tab List.

All your buffers, tabs, and tab layouts can be persisted as a workspace. It's like taking a picture of your desk with an instant camera. You can save multiple workspaces per project with the Workspace List.

Getting Started

Installation

If you use vim-plug, then add to your vimrc file (whose path is shown by :help vimrc):

Plug 'vim-ctrlspace/vim-ctrlspace'

You can also clone the repository to your vimfiles directory (whose path is shown by :help vimrc):

git clone https://github.com/vim-ctrlspace/vim-ctrlspace.git .

Basic Settings

First please make sure that you set nocompatible and hidden options, and set encoding=utf-8 (as required by the plugin) in your .vimrc: >

set nocompatible
set hidden
set encoding=utf-8

Tabline

If you feel brave enough turn off tabline:

set showtabline=0

Tabline in Vim has very limited capabilities and as Vim-CtrlSpace makes use of tabs intensively, tabline would just get in your way. Tab List (<l>) makes tabline obsolete ;).

Neovim

Neovim requires adding the following line to your .vimrc or init.vim:

let g:CtrlSpaceDefaultMappingKey = "<C-space> "

Note the trailing space at the end of the mapping. Neovim doesn't mind it, but it makes vim-ctrlspace's "is the mapping left at default" check fail so it won't change the mapping to <nul>.

First Steps

Alright! You've hopefully installed, configured Vim-CtrlSpace, and restarted Vim (otherwise do it!). Now you're wondering how to start using this thing.

First, you need to select a project. Vim operates in a directory, described as CWD (Current Working Directory). If you've just started a MacVim it's probably pointing to your home directory (issue :pwd to check it).

I advise you to add a project to the Bookmark List by opening the plugin window (<C-Space>) and pressing <b>. The plugin will ask for a project directory.

Make sure that the path is not your home directory. Otherwise the plugin will start indexing all your files which will be pointless and resource exhaustive. Be concrete and provide a real path to a project. Once your bookmark is created, you can go there with <CR>.

Now open some files with <o>. Finally save a workspace with <w> by providing your first workspace name.

For more information please check out Vim-CtrlSpace help directly in Vim:

:help ctrlspace

For key reference press <?> inside the plugin window.

Fuzzy Search Hints

If you are used to hitting the <ctrl-P> key combination for fuzzy search, add this to your .vimrc file:

nnoremap <silent><C-p> :CtrlSpace O<CR>

Be sure to remember to refresh your search file list using <r> command.

Automatically Saving Workspace

Ctrl-Space can automatically save your workspace status based on configurations below:

let g:CtrlSpaceLoadLastWorkspaceOnStart = 1
let g:CtrlSpaceSaveWorkspaceOnSwitch = 1
let g:CtrlSpaceSaveWorkspaceOnExit = 1

Advanced Settings

Go Engine

The plugin provides engine compiled for popular operating systems and architectures. By default it will attempt to detect your OS and architecture. To see if auto detection was successful press <?>.

To speed up the startup of Vim, replace it by a custom simpler one that restricts to those architectures most probably used by you, and does not involve system calls. For example, if you use vim-plug, then by adding to your vimrc:

if has('win32')
    let s:vimfiles = '~/vimfiles'
    let s:os   = 'windows'
else
    let s:vimfiles = '~/.vim'
    if has('mac') || has('gui_macvim')
        let s:os = 'darwin'
    else
    " elseif has('gui_gtk2') || has('gui_gtk3')
        let s:os = 'linux'
    endif
endif

let g:CtrlSpaceFileEngine = s:vimfiles . '/plugged/vim-ctrlspace' . '/bin/file_engine_' . s:os . '_amd64'

The file engine binaries have been compiled for various OS's and CPU types, but only those for Linux, MacOS and Windows on 64 bit architectures are available in the git repository. The other versions for their 32 bit architecture counterparts, as well as for FreeBSD, NetBSD and OpenBSD on ARM, MIPS, amd64 and 32 bit architectures can be downloaded at:

<https://git.io/vim-ctrlspace-release-all_os_file_engines>

To find more about setting up the file engines, check:

:help g:CtrlSpaceFileEngine

Lastly, this file engine sources the list of files it searches through from a text file cache (cs_files, typically stored under .git/). For small to medium-sized projects (say <1k files as a cautious estimate), where loading from this files cache isn't likely to yield a noticeable speed boost, and you might instead rather not think about when to refresh the cache (for instance on switching to a branch with different files), you may disable the cache and by extension forgo using the Go file engine by setting the option below:

let g:CtrlSpaceEnableFilesCache = 0

Symbols

Vim-Ctrlspace displays icons in the UI if your font supports UTF8, or ASCII characters as a fallback. Some symbols (glyphs) might not look well with the font you are using, so feel free to change and adjust them.

I use the following symbols of the Inconsolata font in MacVim :

if has("gui_running")
    " Settings for MacVim and Inconsolata font
    let g:CtrlSpaceSymbols = { "File": "", "CTab": "", "Tabs": "" }
endif

Since it's impossible to provide universal character set that would look well on any machine, the fine tuning is left to you.

You can find more about this tuning option in the plugin help:

:help g:CtrlSpaceSymbols

If you feel that you have found a better symbol for a given view, you are more than welcome to open a pull request.

Glob Command

Another important setting is the Glob command that collects all files in your project directory. The Glob commands rg, fd and ag respect .gitignore rules (where ag does not support the re-inclusion prefix ! that re-includes files excluded by a previous exclusion pattern) and are faster (in the given order as showed a coarse benchmark on Linux) than that built-in. They can be used by adding the following lines to vimrc:

if executable('rg')
    let g:CtrlSpaceGlobCommand = 'rg --color=never --files'
elseif executable('fd')
    let g:CtrlSpaceGlobCommand = 'fd --type=file --color=never'
elseif executable('ag')
    let g:CtrlSpaceGlobCommand = 'ag -l --nocolor -g ""'
endif

Search Timing

If your projects have more than 100 000 files, then you can make the file search more responsive by increasing the plugin's fuzzy search delay timing value:

let g:CtrlSpaceSearchTiming = 500

Colors

Finally, you can adjust some plugin colors. By default plugin uses the following setup:

hi link CtrlSpaceNormal   PMenu
hi link CtrlSpaceSelected PMenuSel
hi link CtrlSpaceSearch   Search
hi link CtrlSpaceStatus   StatusLine

However some color schemes show search results with the same colors as PMenu groups. If that's your case try to link CtrlSpaceSearch highlight group to IncSearch instead:

hi link CtrlSpaceSearch IncSearch

Of course nothing prevents you from providing your own highlighting, for example:

hi CtrlSpaceSearch guifg=#cb4b16 guibg=NONE gui=bold ctermfg=9 ctermbg=NONE term=bold cterm=bold

Authors and License

Copyright © 2013-2020 Szymon Wrozynski and Contributors. Licensed under MIT License conditions.

Vim-CtrlSpace is inspired by Robert Lillack plugin VIM bufferlist © 2005 Robert Lillack. Moreover some concepts and inspiration has been taken from Vim-Tabber by Jim Steward and Tabline by Matthew Kitt.

Special thanks to Wojtek Ryrych for help and patience ;) and all Contributors.

vim-ctrlspace's People

Contributors

bodograumann avatar chrisbra avatar clarity20 avatar cometsong avatar davvid avatar iicurtis avatar jyscao avatar konfekt avatar lemeb avatar marcinmagier avatar mattn avatar maxst avatar minion3665 avatar montefra avatar octobanana avatar rgrinberg avatar ryrych avatar sappo avatar sittim avatar slava avatar swoh816 avatar szw avatar tenfyzhong avatar unclechu avatar zerongjiang 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-ctrlspace's Issues

Change buffers without save the current one

Currently, if we are editing some file and, for any reason, it's necessary to change to another buffer, this isn't possible because save the current one it's an obligation.

Indeed, it's possible to accomplish that opening the other buffer in a splited window, but I think if we can change between unsaved buffers it would be great.

Using ag for fuzzy finding

Hi,
I've been playing with CtrlSpace for a few days, and now I'm getting used to it, it's great!

One thing bothers me though: fuzzy finding.
I've seen in a number of issues that you already know its weaknesses (speed, mainly), but I've found no issues related to using ag (aka The Silver Searcher) for fuzzy_finding.

(Well, there's #27, but it was to search inside of the files)

What makes CtrlP awesome is the ability to use ag (see http://stackoverflow.com/a/18601066/718734), it makes it blazing fast and it allows to ignore .gitignore'd files for free! I'd love to switch completely from CtrlP to CtrlSpace, and would love to see ag's support coming into CtrlSpace.

What's your thought about that?

Could you update the doc.txt file?

Hi szw,
I really like the concept of vim-ctrlspace but the fact that the documentation is updated in the README and not in the doc.txt doesn't help new users like me.
Using :help ctrlspace to have all the necessary information would be really a good thing because it wouldn't break the user's workflow (contrary to opening the README with the tables in html format).
Keep up the work.

TaurusOlson

global tab_bufs_number_to_show for tabline customization

To display the number of open buffers for every tab in the tabline of other plugins such as lightline too, how about making global the function

function! <SID>tab_bufs_number_to_show(bufs_number)
  let bufs_number_to_show = ""

  if a:bufs_number > 1
    if g:ctrlspace_unicode_font
      let small_numbers = ["⁰", "¹", "²", "³", "⁴", "⁵", "⁶", "⁷", "⁸", "⁹"]
      let number_str    = string(a:bufs_number)

      for i in range(0, len(number_str) - 1)
        let bufs_number_to_show .= small_numbers[str2nr(number_str[i])]
      endfor
    else
      let bufs_number_to_show = ":" . a:bufs_number
    endif
  endif

  return bufs_number_to_show
endfunction

In this way, one could customize other tabline plugins to imitate the ctrl-space tabline.

Exit ctrlspace window with C-c

Not respecting C-c is not very nice for people that are used to its behavior everywhere else in Vim. Anyway way to restore this?

Is that possible put all cs_files, cs_workspace & cs_cache in the same folder?

Currently, I can customize the cache_dir (according to the document), and force .cs_cache saved in my preferred folder like ~/.vim/cache/ctrlspace.

Is that possible support this for cs_files and cs_workspace, too?

Therefore I can have them all in the same folder instead of in repository itself, and easier for management.

Mark

Enhancement: raw search mode for performance boosting

Again, this is not the plugin issue but rather a performance issue relating to a big project which I am commonly having :)

The searching works very well in a fair big number of files' directory, though I am curious how the gradual incremental search is implemented. It behaves a little different to some other plugins, eg: ctrlp, cmdT etc. It works anyway. The problem comes at the time to search in a big list of files. It is just deadly slow and intolerable.Every key stroke would become freezing and unresponsive. In this use case, it's just not work.

A proposed solution: to provide a simple raw search list.

Since we are have the cached file list in hidden directory, we can render it into the quickfix/ctrlspace window, give user a key to use vim's raw search: / or ? to search, with their own preference using regular expression. Provide:

  1. no incremental search, search when hit enter
  2. highlight of search keywords (guess vim's search will do)
  3. provide common key binding, eg:t -> open in tab, p->preview .... etc
  4. provide a key to filer out the lines without searched result.
  5. allow toggle on/off this search window
    .... anything you can think of for the best of search

Thanks,

Stephen

Worspace not loading files with autochdir

I have a workspace file with following details,

config/color.vim|config/misc.vim|config/format.vim,2

I have autochdir. Somehow these files are not loaded properly when I star vim from project root. So, workspace needs to be either ./config/color.vim and so on. OR use full paths. Currently only the files in project root are loading properly.

Is it possible to use full paths instead of relative?

color settings does not work

I have tried tuning the settings using various ways(adjust the number), there is no change at all.

CtrlSpaceSelected term=reverse ctermfg=yellow ctermbg=green cterm=bold
CtrlSpaceNormal term=NONE ctermfg=red ctermbg=blue cterm=NONE
CtrlSpaceFound ctermfg=125 ctermbg=NONE cterm=bold

Functions on open and close buffer

It would be nice if add option to make some actions when open and close ctrl+space buffer.

For example, it's useful to disable status line in ctrl+space buffer.

Project Root Per Workspace

First of all, ctrlspace has a very well designed UI. I'm loving it! Thanks for a great plugin!

My issue is that although I like being able to specify the project root for my workspace when I first open ctrlspace, I would prefer not to have to start a new instance of VIM to set a new project root. It would be great if each workspace could have its own project root, which could be changed in the workspace list mode with a hotkey like 'c' or 'C'. Perhaps 'c' would just change the project root to cwd, and 'C' would prompt the user for a new project root.

I realize that there will be an issue when merging two workspaces with different project roots. Would it be possible to just have multiple project roots for each workspace? The file list mode would then return an aggregate list of all files from all project roots.

This feature would definitely fit my workflow, because I am often having to look at header files in multiple projects (about 2-5 at a time) in order find function names and parameters that I need to reference.

Let me know what you think. I'd be willing to work on a patch for this if it fits well into the current design.

Thanks!

Customizable Keybindings

For most vim plugins, I don't use default bindings. A big reason is because I use colemak and don't have jk (n and e are in the j and k positions).

For example, I do this for unite:

autocmd FileType unite call s:unite_settings()
function! s:unite_settings()
    nmap <buffer> <ESC> <Plug>(unite_exit)
    " nmap <buffer> n j
    nmap <buffer> n <Plug>(unite_skip_cursor_down)
    " nmap <buffer> e k
    nmap <buffer> e <Plug>(unite_skip_cursor_up)
endfunction

I realize that this doesn't work for several reasons with ctrlspace (the ctrlspace buffer does not seem to have a filetype, there are no s, and something like "nmap n j" won't work in the first place). Is there a recommended way to change the default bindings?

For people who don't use QWERTY and for those who like to choose their mappings a way to do this without having to manually go through the plugin and change them all would be convenient.

vim blinking when editing with unsaved tabs

I'm using terminal vim and, when I search and open some files in different tabs, if some of this tabs are unsaved, when I'm typing in any other tab, the screen blinks in every keystroke... If I change to that unsaved tab and save it, boom, the blink immediately stops!

I'm not sure, but I think this is happening after I updated the plugin (today).

save workspace on exit, but don't ask for unknown workspace root

This plugin is what I ever wanted! I use it at a daily basis for months now and really like it, great work! You should add a 'donate' button somewhere ;)

Is it possible to have "auto workpspace saving" for only known project roots? I don't need CtrlSpace for e.g. editing ~/TODO.txt.

Vim complaining at startup about g:ctrlspace_project_root_markers

Hi,

I've started using your plugin, it is extremely useful. You've done a great job.

I have let g:ctrlspace_project_root_markers += ["proj.sln"] in my vimrc, but at startup Vim/GVim throws this error at me:
E121: Undefined variable: g:ctrlspace_project_root_markers

The other ctrlspace settings I have in the vimrc:
let g:ctrlspace_show_tab_info =1
let g:ctrlspace_show_key_info = 1
let g:ctrlspace_show_unnamed = 1
let g:ctrlspace_save_workspace_on_exit = 1
let g:ctrlspace_load_last_workspace_on_start = 1

Do you have any idea why this is?
If I run the let command in VIm manually, without the assignment, VIm shows me that the value appended to it is there...

Cheers,
robcsi

Tab numbers

Hi Szymon,

is there a way how to make the numbers representing different tabs bold?
Something like hi CtrlSpaceTablineTabNumber?

2014-03-17--d187

It would make it easier for the eyes of a user to grep out the number of the tab.

Best from Czech,

Martin

Feature - go to previous/next buffer without opening plugin window

Hi, thank you for a great plugin. I'm using it for more than two months as the best way to handle large number of opened buffers.

I defined following mappings to directly jump to the previous and next buffer in current tab:

nmap <A-k> :CtrlSpace <CR> k <CR> 
nmap <A-j> :CtrlSpace <CR> j <CR>

This works, but plugin window flicks each time. Would you mind adding two more commands for jumping to the next/previous buffer if it's really not possible to achieve this without opening the plugin window?

Question regarding Unicode star and comments about root folder

Hi Syzmon, I absolutely love CtrlSpace, and it has improved my work flow tremendously already. I had two questions, the first I think I solved but would be useful to raise.

I struggled getting CtrlSpace to properly set the root folder and I wasn't sure about the advice given for this in the help:

autocmd BufEnter, BufNewFile * silent! lcd %:p:h

as I didn't want autocmd fooling around with every buffer and file that I created or opened.
So I instead use the following autocmd in my vimrc:

autocmd! VIMEnter * cd C:\Users\Alain

which waits for VIM to load and then changes to the specified directory only once, which CtrlSpace picks up with no hassles, allowing me to load my cs_workspace stuff which is in that directory.

My second issue is related to my system not picking up the Unicode star symbol which shows the active buffer. Instead I get an empty square, see attachment. I looked at changing this in the
let g:ctrlspace_symbols = {
\ "cs" : "⌗",
\ "tab" : "⊙",...
}
but was unsuccessful. How can I replace the unicode symbol with another one of my choice.

Thanks again for an excellent plugin!
Alain
capture

Problems with swp files

Hi Szymon,

sometimes I used to experience that the Ctrl space didn't load my workspace and just hanged. I had to press ctrl+C, delete the workspace and create it again.
Today I have realized that the problem was caused by loading a "crached" file which had an existing swp file.

Not sure if this is something you can deal with, just wanted to let you know about the behaviour.

Best from Czech,

Martin

Can't exit the WS mode with mapping key after remap

First, thank you for this great plugin, it makes session management exactly the way I'd expect vim to do !

I remapped the mapping key to a comma:
let g:ctrlspace_default_mapping_key = ","
Strangely I can make CtrlSpace appear with ,, but not exit (although I can still use q). I've tried with other keys, it doesn't work either.

It seems that the WS loading is very slow

Here are some informations:

  • Ubuntu 12.10
  • GVim 7.4
  • Ruby bindings enabled
  • Project is a git repo
  • My workspace contains 8 Tabs,30 buffers

The workspace loading consumes about 15sec or more!

Other suggestion:

  • When saving workspace , we may want to save some session along with the WS(eg. the PWD) .
  • Display root path of the workspace on CS status bar.

Thanks for your work!

Enhancement: cache file list generating to boost speed

It takes some time to load the file list for the first time when type "o" or "O". For a big project, this takes sometime. And I found this is almost the weakness of every vim plugin.

Is there a way, we cache the file list result, eg in .git, give user to search something first, then at some later stage, ctrl-space silently do update of the cache file to load the changes if there is?

Search speed suggestion

Hi, @szw! I'm new in Vim world and I'm not versed in Vim yet, but what I saw until now, this plugin is in TOP 3! I just saw your post about it a few days ago in Vim G+ community and today I decided to test.

There are so many commands, so I'll learn them in my time; but one thing I would like to discuss is about the search speed. I know the instructions are:

If you want to increase fuzzy search speed, make sure you have decent Ruby bindings enabled in (compiled into) your Vim. The plugin will try to use your Ruby by default.

But me, as most those starting in Vim, don't know exactly how check this and/or install this and/or don't want pass through the "risk" of recompile Vim - and by the actual speed of my CtrlSpace search, I know I haven't "decent Ruby bindings enabled".

Indeed, with CtrlSpace I don't need CtrlP anymore (and I already uninstall it), but somehow his search was much faster, even without that Ruby bindings...

I don't know how CtrlP does it because I'm unversed in VimScript/VimL by now, but I think if CtrlSpace use a similar approach, the search would be faster without that Ruby bindings conditional.

Again, this is just a n00b person point of view trying to help. :-)

Regards!

Ctrlspace not starting up in windows

I just installed ctrlspace with pathogen. In my gvim it works fine.
However in my terminal vim (same configuration) it did not start up.

I realized nothing was mapped to , so I tried this with no effect:
let g:ctrlspace_set_default_mapping = 0
let g:ctrlspace_set_default_mapping_key = ""

github does not show this right - there is a C-Space in those brackets

After looking through the plugin code for a moment, I tried this dirty hack in my vimrc:
nmap :CtrlSpace

With this it works, but I don't think it's how the setup is supposed to be done.

Does CtrlSpace fully work without Ruby?

I am starting to change my ways into the CtrlSpace ways. It's great.
But that could mean that I become CtrlSpace dependant for productivity.

Github says that CtrlSpace source code is 5% Ruby.

I usually clone my .vimrc and plugins into remote servers to have it the way I like it, but installing Ruby where otherwise not needed is a little too much.

Can CtrlSpace be used without it?
Are all features available?

Thanks!

nomodifiable files are not getting listed

Hi,

I have started using the plugin since last week and it is amazing. it requires some workflow changes but i guess it is worth the effort.

One thing that i am observing is that if the has a 'nomodifiable' flag it does not get listed in the buffer list.

Is is something in the setting that i might be missing.

space key down to open file errored

When I try to open a file in the backend using "space", when I selected this entry "build/proj_26-03-2013_1364258925/511 proj2-itemkey000000220810/CMJ070000511001 v1
4 0 (ROCK DM DDCK OF4 - 13) (2).xml", then it erroed and gave:

Error detected while processing function 61_keypressed..61_load_many_files:
line 8:
E172: Only one file name allowed: :e /Users/user1/data/workspace/project-resources/build/proj_26-03-2013_1364258925/511 proj2-itemkey000000220810/CMJ070000511001 v1
4 0 (ROCK DM DDCK OF4 - 13) (2).xml

Save cwd in workspace

Wondering if it would be possible to save the current working directory for a Workspace. The first step of loading a WS could simply be :cd $current_working_directory.

That way, I could save all of my workspaces (for all of my projects) in one location. Maybe ~/.cs_workspaces. This would let me get a list of all possible projects/workspaces from any context and therefore be able to switch between projects without changing my cwd manually.

Maybe this isn't what CTRL Space was intended for, but I'd like to have larger project-level workspaces for each of my individual projects and it would be nice to navigate between them with just CTRL Space (not :cd or command-line).

Feature - ag integration for searching and list

Not sure if this request will be considered out of scope of vim-ctrlspace, but since ctrl-space is now my best favor, I will give it a try to ask.

I will need feature to do file search, like the search in intellij, sublime etc. The search result will be listed in a output window, I can jump to search result file window/buf if I hit enter when selecting a search entry. I can toggle on this search result window later on if need it.

I am currently use unite with the customisation of using ag command, but it's not perfect as I am expecting. A few dissatisfactions:

  1. Even though I configed unite to use ag, but I am not sure if unite has actually invoke or use it for searching, it's just not so responsive and take longer time then use the ag command in terminal.
  2. There is no highlighted color for search result window like ag does
  3. If I hit the enter to jump to the file, I can not go back to the search result window again, for a large directory, it takes long time to search again.

For your consideration :)

Feature - jump to the tab/buf instead of opening all the time

First, this is great plugin. Great Job.

I am not sure if I am right. It seems this plugin only gives you the ability to open/preview the file in the window current cursor is at. It's not what I am expecting at first glimpse of the plugin.

I want a simple way of jump around and switch to the window using ctrlspace when I type a key, say "o".

My normal way of using vim is to open the files in tabs I'd like to make changes and then switch among them. Opening the file using ctrlp actually messed up the current window.

I am hoping the feature is hidden and I am not finding it. Please can you confirm, or is there a way to add this feature?

Thanks

Stephen

E15: Invalid expression: getbufvar

Hi Szymon

I'm getting these errors after i updated your fine plugin. Could you please help me fix it?
It's happening everytime when I press ctrl-space:

E15: Invalid expression: getbufvar(bufentry.number, "ctrlspace_jump_counter", 0)
line 14:
E121: Undefined variable: current_jump_counter
E15: Invalid expression: current_jump_counter > max_counter
line 12:
E118: Too many arguments for function: getbufvar
E15: Invalid expression: getbufvar(bufentry.number, "ctrlspace_jump_counter", 0)
line 14:
E121: Undefined variable: current_jump_counter
E15: Invalid expression: current_jump_counter > max_counter
line 12:
E118: Too many arguments for function: getbufvar
E15: Invalid expression: getbufvar(bufentry.number, "ctrlspace_jump_counter", 0)
line 14:
E121: Undefined variable: current_jump_counter
E15: Invalid expression: current_jump_counter > max_counter
Error detected while processing function 38_ctrlspace_toggle..38_find_activebufline:
line 12:
E118: Too many arguments for function: getbufvar
E15: Invalid expression: getbufvar(bufentry.number, "ctrlspace_jump_counter", 0)

King regards,
/Bjarni Olsen

CtrlSpace GitIgnore

How about a CtrlSpace hook function that fires when setting the
project root dir. For example, to populate g:Ctrlspace_ignored_files
by the entires in the .Gitignore file, if available.

That is, something like

function! CtrlSpaceRootDirHook()
let g:ctrlspace_ignored_files = '\v'.substitute(netrw_gitignore#hide(),',','|',"g")
endfunction

To cite what netrw_gitignore#hide() does:

Netrw provides a helper function 'netrw_gitignore#Hide()' that, when used with
|g:netrw_list_hide| automatically hides all git-ignored files.

'netrw_gitignore#Hide' searches for patterns in the following files:
    './.gitignore'
    './.git/info/exclude'
    global gitignore file: `git config --global core.excludesfile`
    system gitignore file: `git config --system core.excludesfile`

Files that do not exist, are ignored.
Git-ignore patterns are taken from existing files, and converted to patterns for
hiding files. For example, if you had '*.log' in your '.gitignore' file, it
would be converted to '.*\.log'.

However, there is also the simple, self-contained script at

http://stackoverflow.com/questions/579871/can-i-make-vim-respect-my-gitignore-files

that could achieve that.

Lag when closing CtrlSpace

Opening CtrlSpace happens instantly, but there is a slight lag when closing it by pressing
Ctrl-C/Ctrl-Space/Esc.

Is anyone else experiencing this?

possible autochdir workaround

Hello,

Just found the following lines in the documentation to CtrlP.vim, and they seem to behave well with respect to ctrlspace, better than set autochdir or the workaround proposed here. The autocmd sets the cwd to the current project root, similar to what ctrlspace does when opening it first time.

  " A standalone function to set the working directory to the project's root, or
  " to the parent directory of the current file if a root can't be found:
  function! s:setcwd()
    let cph = expand('%:p:h', 1)
    if cph =~ '^.\+://' | retu | en
    for mkr in ['.git/', '.hg/', '.svn/', '.bzr/', '_darcs/', '.vimprojects']
      let wd = call('find'.(mkr =~ '/$' ? 'dir' : 'file'), [mkr, cph.';'])
      if wd != '' | let &acd = 0 | brea | en
    endfo
    exe 'lc!' fnameescape(wd == '' ? cph : substitute(wd, mkr.'$', '.', ''))
  endfunction

  autocmd BufEnter * call s:setcwd()

Can you please put the available keys option back into the status bar?

Hi,

I just experienced that the available keys info in status bar are no longer available when pressing Ctrl+ and then ?.

Can you please put it back or provide an option to turn it on and off? I really liked having it there.
What was the reason you removed it for?

Keep up the good work,
robcsi

feature request: workspace manager

First, I am not clear where the workspace settings has gone to and saved at. It feels a little magic when I use L to load the workspace, that's great feeling.

Is there a feature that I would type of key, eg"a", to load common used directories in memory. For example, currently I have worked in: ~/data/proect1, and I saved workspace-project1, and ~/data/project2 and did same for workspace-project2, but occasionally I also worked in a project under ~/a/b/c/d/e/......./z which I need to spend a min to refresh my memory to cd to. ctrlspace would allow me to use "a" to see the list of common dir as key to link to one...multiple workspaces related to it. eg:

one I typed "a", i see the list:

  1. ~/data/project1:3
  2. ~/data/project2:10
    ........
    m. ~/a/b/c/d/e/......./z:x

It list the common directories, I can just type a vi, no matter where I am located at to cd to that project and setup the project root as selected.

Happy ctrl-space!

vi file1 file2 file3 should put them into buf list by default

when use vi command to open multiple files, eg: vi file1 file2 file3, it will only show one file in the buf by default, buffer list plugin gives 3 files though, if you open buffer list(not to open any other file yet), somehow when use ctrl-space, it will show two files.

should this be feature or a bug?

API: workspace save/load

First of all: Great plugin! You really thought of details which makes the plugin really good.

I just have a request, would it be possible to provide some more commands for workspace to be saved and loaded. Something like:

:CtrlSpaceWorkspaceSave "workspace-name"
:CtrlSpaceWorkspaceLoad "workspace-name"

It would help with plugin integration.

Ignore git initiated vim sessions with loadlastactiveworkspace

When performing a git command that fires open a vim session (i.e. git merge) and loading last active workspace enabled, ctrl space will load the last active workspace. Would be nice (if possible) to have the git window focused instead. Or there may be a workaround betting launching vim with a specific flag by setting the git editor (or an environment variable?)

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.