All Projects → hackhowtofaq → Vim Solargraph

hackhowtofaq / Vim Solargraph

Licence: mit
vim plugin (wrapper) for Solargraph gem - IDE tools for the Ruby language.

Projects that are alternatives of or similar to Vim Solargraph

Winresizer
very simple vim plugin for easy resizing of your vim windows
Stars: ✭ 353 (+635.42%)
Mutual labels:  vim-plugins
Vim Markdown Preview
A light Vim plugin for previewing markdown files in a browser - without leaving Vim.
Stars: ✭ 530 (+1004.17%)
Mutual labels:  vim-plugins
Context.vim
Vim plugin that shows the context of the currently visible buffer contents
Stars: ✭ 688 (+1333.33%)
Mutual labels:  vim-plugins
Vim Devicons
Adds file type icons to Vim plugins such as: NERDTree, vim-airline, CtrlP, unite, Denite, lightline, vim-startify and many more
Stars: ✭ 4,473 (+9218.75%)
Mutual labels:  vim-plugins
Tmux Complete.vim
Vim plugin for insert mode completion of words in adjacent tmux panes
Stars: ✭ 447 (+831.25%)
Mutual labels:  vim-plugins
Evervim
A Modern, Powerful & Modular Vim Distribution
Stars: ✭ 568 (+1083.33%)
Mutual labels:  vim-plugins
Pear Tree
A Vim auto-pair plugin that supports multi-character pairs, intelligent matching, and more
Stars: ✭ 327 (+581.25%)
Mutual labels:  vim-plugins
Hot Reload.vim
A (Neo)vim plugin for Flutter to automatically hot reload the project every time a file is saved
Stars: ✭ 33 (-31.25%)
Mutual labels:  vim-plugins
Vim Plugins Profile
🕓 Profile Vim's plugins, generate awesome statistics and optimize (n)vim startup time
Stars: ✭ 508 (+958.33%)
Mutual labels:  vim-plugins
Vim Wakatime
Vim plugin for automatic time tracking and metrics generated from your programming activity.
Stars: ✭ 669 (+1293.75%)
Mutual labels:  vim-plugins
Vim Markdown Toc
A vim 7.4+ plugin to generate table of contents for Markdown files.
Stars: ✭ 427 (+789.58%)
Mutual labels:  vim-plugins
Vim Ide
VIM configured as powerful IDE (Integrated Development Environment)
Stars: ✭ 441 (+818.75%)
Mutual labels:  vim-plugins
Tagbar
Vim plugin that displays tags in a window, ordered by scope
Stars: ✭ 5,322 (+10987.5%)
Mutual labels:  vim-plugins
Braceless.vim
🐍 Text objects, folding, and more for Python and other indented languages.
Stars: ✭ 376 (+683.33%)
Mutual labels:  vim-plugins
Minpac
A minimal package manager for Vim 8 (and Neovim)
Stars: ✭ 693 (+1343.75%)
Mutual labels:  vim-plugins
Rainbow csv
🌈Rainbow CSV - Vim plugin: Highlight columns in CSV and TSV files and run queries in SQL-like language
Stars: ✭ 337 (+602.08%)
Mutual labels:  vim-plugins
Dotfiles
💾 Ian's dotfiles, utils, and Zsh/Vim/tmux configs
Stars: ✭ 554 (+1054.17%)
Mutual labels:  vim-plugins
Vim Strand
A barebones Vim plugin manger written in Rust
Stars: ✭ 38 (-20.83%)
Mutual labels:  vim-plugins
Vimcompletesme
You don't Complete Me; Vim Completes Me! A super simple, super minimal, super light-weight tab completion plugin for Vim.
Stars: ✭ 752 (+1466.67%)
Mutual labels:  vim-plugins
Alchemist.vim
Elixir Integration Into Vim
Stars: ✭ 632 (+1216.67%)
Mutual labels:  vim-plugins

vim-solargraph

vim plugin (wrapper) for Solargraph - IDE tools for the Ruby language.

NOTES

Please consider this as a first prototype pre ALPHA version, just to prove that it can be done.

I am not familiar with vimscript, so most of vimscript code is trial and error + a lot of googling. This plugin was written in 10 hours after the initial idea (first commit).

INSTALLATION

I've tested this only on Linux. If you think you can make it work on Windows or Mac please submit a patch.

Prerequisites (my setup)

  • Install Ruby (2.4.1)
  • Compile vim with +ruby support
  • gem install json rest-client solargraph
  • Install dbakker/vim-projectroot

vim-plug

Add the following

Plug 'hackhowtofaq/vim-solargraph'

Manual (Not ready yet)

Download vim-solargraph.tar.gz from GitHub, extract it, and copy the contents to your ~/.vim directory.

neocomplete

If you are using neocomplete keep reading.

The following is my neocomplete setup. I am still experimenting, trying to find the optimal settings for ruby code.

		" neocomplete {

		" Neosnipet
		" Note: It must be "imap" and "smap".  It uses <Plug> mappings.
		" SuperTab like snippets' behavior.
		imap <expr><TAB> neosnippet#expandable_or_jumpable() ?
					\ "\<Plug>(neosnippet_expand_or_jump)"
					\: pumvisible() ? "\<C-n>" : "\<TAB>"
		smap <expr><TAB> neosnippet#expandable_or_jumpable() ?
					\ "\<Plug>(neosnippet_expand_or_jump)"
					\: "\<TAB>"

		let g:acp_enableAtStartup = 0
		let g:neocomplete#enable_at_startup = 1
		let g:neocomplete#auto_completion_start_length = 1
		let g:neocomplete#enable_refresh_always = 1
		let g:neocomplete#enable_fuzzy_completion = 0
		let g:neocomplete#enable_smart_case = 1
		let g:neocomplete#enable_auto_delimiter = 1
		let g:neocomplete#enable_auto_select = 1
		let g:neocomplete#enable_underbar_completion = 1
		let g:neocomplete#enable_camel_case_completion  =  1

		if !exists('g:neocomplete#force_omni_input_patterns')
			let g:neocomplete#force_omni_input_patterns = {}
		endif
		let g:neocomplete#force_omni_input_patterns.ruby = '[^. *\t]\.\w*\|\h\w*::'

		" Define keyword.
		if !exists('g:neocomplete#keyword_patterns')
			let g:neocomplete#keyword_patterns = {}
		endif
		let g:neocomplete#keyword_patterns['default'] = '\h\w*'

		" Enable heavy omni completion.
		if !exists('g:neocomplete#sources#omni#input_patterns')
			let g:neocomplete#sources#omni#input_patterns = {}
		endif

		if !exists('g:neocomplete#same_filetypes')
			let g:neocomplete#same_filetypes = {}
		endif
		let g:neocomplete#same_filetypes.ruby = 'eruby'

		let g:neocomplete#data_directory = $HOME . '/.vim/cache/neocomplete'

		" Enable omni-completion.
		autocmd Filetype ruby,eruby setlocal omnifunc=solargraph#CompleteSolar

		" } neocomplete

WORKSPACE (solargraph)

A folder having one of the following entries in it, is assumed to be the workspace folder.

['.projectroot', '.git', '.hg', '.svn', '.bzr', '_darcs', 'build.xml']

USAGE

OR

  • Create file a.rb and paste
# a.rb
class A
  def testInstanceA
  end

  def self.testClassA
  end
end
  • Create file b.rb and paste
# b.rb
class B
  def testInstanceB
  end

  def self.testClassB
  end
end
  • Start solargraph server $ solargraph server

  • Create file test.rb

# test.rb

ca = A.new
A.te   # <---- You should see testClassA
ca.te  # <---- You should see testInstanceA


cb = B.new
B.te  # <---- You should see testClassB
cb.te # <---- You should see testInstanceB

Without neocomplete use CTRL+x CTRL+o shortcut to autocomplete after the dot .

AUTHOR

George Lazaridis [email protected]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].