All Projects β†’ gokcehan β†’ vim-opex

gokcehan / vim-opex

Licence: other
Vim operators to execute text objects

Programming Languages

Vim Script
2826 projects

Projects that are alternatives of or similar to vim-opex

Rigel
🌌 Colorscheme for vim, terminal, vscode and slack - based on the star Rigel ✨.
Stars: ✭ 324 (+1605.26%)
Mutual labels:  vim-plugin, nvim
Coc.nvim
Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers.
Stars: ✭ 18,268 (+96047.37%)
Mutual labels:  vim-plugin, nvim
Vimrc
πŸ“ Vim Configuration for nerds with vim-plug
Stars: ✭ 33 (+73.68%)
Mutual labels:  vim-plugin, nvim
Ncm R
R autocompletion for Neovim and vim 8 πŸ“ πŸ“Š ⚑️
Stars: ✭ 102 (+436.84%)
Mutual labels:  vim-plugin, nvim
Dot-It-Up
A collection of dotfile scripts, plugins, and clever hacks so that you can become the master of your own OS! πŸš€
Stars: ✭ 254 (+1236.84%)
Mutual labels:  vim-plugin, nvim
Spaceduck
πŸš€ πŸ¦† An intergalactic space theme for Vim, Terminal, and more!
Stars: ✭ 177 (+831.58%)
Mutual labels:  vim-plugin, nvim
Vim Lsp Cxx Highlight
Vim plugin for C/C++/ObjC semantic highlighting using cquery, ccls, or clangd
Stars: ✭ 231 (+1115.79%)
Mutual labels:  vim-plugin, nvim
Mkdx
A vim plugin that adds some nice extra's for working with markdown documents
Stars: ✭ 295 (+1452.63%)
Mutual labels:  vim-plugin, nvim
vim-lamp
πŸ’‘Language Server Protocol client for Vim.
Stars: ✭ 34 (+78.95%)
Mutual labels:  vim-plugin, nvim
code runner.nvim
Neovim plugin.The best code runner you could have, it is like the one in vscode but with super powers, it manages projects like in intellij but without being slow
Stars: ✭ 234 (+1131.58%)
Mutual labels:  vim-plugin, nvim
qf helper.nvim
A collection of improvements for the quickfix buffer
Stars: ✭ 70 (+268.42%)
Mutual labels:  vim-plugin, nvim
nvim-toggle-terminal
NeoVim plugin that toggles a terminal buffer in the current window maintaining the same shell instance
Stars: ✭ 54 (+184.21%)
Mutual labels:  vim-plugin, nvim
bolt.nvim
⚑ Ultrafast multi-pane file manager for Neovim with fuzzy matching
Stars: ✭ 100 (+426.32%)
Mutual labels:  vim-plugin, nvim
vim-bettergrep
A better way to grep in vim.
Stars: ✭ 15 (-21.05%)
Mutual labels:  vim-plugin, nvim
vim-qf-preview
Preview the quickfix item under the cursor in a popup window
Stars: ✭ 32 (+68.42%)
Mutual labels:  vim-plugin
dotfiles
The best dotfiles ever to be dot-filed
Stars: ✭ 17 (-10.53%)
Mutual labels:  nvim
close-buffers.nvim
πŸ“‘ Delete multiple vim buffers based on different conditions
Stars: ✭ 54 (+184.21%)
Mutual labels:  nvim
vim-goyacc
Vim filetype support for goyacc
Stars: ✭ 22 (+15.79%)
Mutual labels:  vim-plugin
nvim-ghost.nvim
πŸ‘» GhostText plugin for Neovim with zero dependencies πŸŽ‰ Supports neovim running inside WSL too! πŸ₯³ Windows/Linux/macOS supported out-of-the-box! πŸ˜„ (Other OSes need python3.6+ installed)
Stars: ✭ 32 (+68.42%)
Mutual labels:  nvim
himalaya
Command-line interface for email management
Stars: ✭ 1,715 (+8926.32%)
Mutual labels:  vim-plugin

vim-opex

Opex is a simple plugin that defines two custom operators to execute text objects (:h motion.txt). First execution operator executes the code and displays any output in messages (:h message.txt). Second appending operator executes the code and appends any output as a comment below the text object.

demo-screencast

Languages

Following languages are supported with their corresponding interfaces:

  • lua (:h if_lua.txt)
  • perl (:h if_perl.txt)
  • python (:h if_pyth.txt)
  • ruby (:h if_ruby.txt)
  • scheme (:h if_mzsch.txt)
  • tcl (:h if_tcl.txt)
  • sh (:h system())
  • vim (:h execute())

Opex is automatically loaded if you have the required feature enabled in vim (e.g. +lua for lua files). If you have installed vim from a repository, you are likely missing most of these features. Therefore, you may need to compile vim from source with corresponding features enabled at compile time.

Installation

Drop autoload/opex.vim to ~/.vim/autoload and any of the files under ftplugin to ~/.vim/ftplugin.

If you are using vim8 you can simply clone this repository as such (:h packages):

mkdir -p ~/.vim/pack/plugins/start
cd ~/.vim/pack/plugins/start
git clone https://github.com/gokcehan/vim-opex.git

If you are using another plugin manager you should know what to do.

Configuration

You can configure mappings for execution (default gx) and appending (default gz) as below:

nmap ge  <plug>(opex-execute)
vmap ge  <plug>(opex-execute)
nmap gee <plug>(opex-execute-line)

nmap ga  <plug>(opex-append)
vmap ga  <plug>(opex-append)
nmap gaa <plug>(opex-append-line)

If you want to disable opex for a specific filetype you can use the following:

let b:loaded_opex_lua = 1

You can change the value of commentstring option to configure output style:

autocmd Filetype lua setlocal commentstring=--[[%s]]

Known Issues

  • Any limitation on the builtin interpreter also applies to opex (e.g. gui, threading).
  • If you accidentally execute an infinite loop, you may need to manually kill the vim process.
  • If you crash the interpreter somehow, plugins that use the same interface may stop working until you restart vim.

License

Public domain.

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].