• Skip to primary navigation
  • Skip to main content
Sal Ferrarello
  • About Sal Ferrarello
  • Speaking
  • Connect
    Mastodon GitHub Twitter (inactive)
You are here: Home / Archives for vim

vim

Getting Started with LuaSnip

Last updated on November 23, 2022 by Sal Ferrarello

This article assumes you are using Neovim (version 0.8.0 or higher) and packer.nvim to manage your plugins. Adding the following loads the LuaSnip plugin, creates a snippet for “func”, and maps “Ctrl + p” to expand the snippet and jump through the fields.

Filed Under: Computing, Dev Tips, Programming, Solution Tagged With: lua, neovim, vim, vimplugin

vim.keymap.set() coc to confirm completion with lua

Last updated on November 13, 2022 by Sal Ferrarello

I’m currently rewriting my Neovim configuration using lua rather than using vimscript. I’m using the coc.nvim plugin and want to map return () to confirm completion. The coc.nvim wiki has an entry to Use to confirm completion however their solution is in Vimscript.

Filed Under: Computing, Dev Tips, Programming, Solution Tagged With: lua, neovim, vim

Vim JSON Format

Last updated on October 30, 2022 by Sal Ferrarello

Vim allows you to run all (or some) of your content through an external program. In this case, we want to use Python to format (i.e. pretty print) our JSON with ‘python -m json.tool’. We an also setup a Vim user defined command to reduce typing (and make it easier to remember).

Filed Under: Dev Tips, Solution Tagged With: lua, neovim, vim, vimscript

Use CTRL-[ as Esc in Vim

Last updated on August 2, 2019 by Sal Ferrarello

The Esc key is not a convenient key to hit on the keyboard. While many will recommend you map another key to act as your Esc key, by default you can use Ctrl-[ instead.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Computing, Dev Tips, Draft, Recommendations Tagged With: vim

Vim Easy Align Custom Rule for $

Last updated on December 26, 2019 by Sal Ferrarello

I use Junegunn’s Vim plugin vim-easy-align to make it easier to align my code. This plugin does not have a default mapping for aligning the dollar sign ($). Because the plugin is designed to be extensible, I was able to add support for aligning by the dollar sign ($) by adding some lines to my .vimrc file.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Draft, Solution Tagged With: neovim, vim, vimplugin

Vim Close All Buffers Except the Current One

Last updated on May 26, 2019 by Sal Ferrarello

Vim has a built-in command to close all windows except the current one (:only), which is nice for focusing on a single buffer. Sometimes I want to cleanup my buffers by closing all of the buffers except for the current one. This custom command is like :only for buffers instead of windows.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Computing, Draft, Solution Tagged With: neovim, vim

Brew Failure in Upgrading to the Development Version Neovim

Last updated on May 20, 2019 by Sal Ferrarello

I wanted to run the latest development version of Neovim (0.4.0) to use some of the latest features (e.g. the floating window). Unfortunately, my attempts to install it were failing. These are my notes on the problem and how I fixed it.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Computing, Draft, Solution Tagged With: neovim, vim

Vim netrw duplicate file

Last updated on May 20, 2019 by Sal Ferrarello

When using Vim sometimes I want to duplicate a file, however the default file explorer in Vim (netrw) does not handle this well. This is a Vim mapping I created to make duplicating a file easier.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Computing, Draft, Solution Tagged With: netrw, vim

Vim Find Your Leader

Last updated on May 2, 2019 by Sal Ferrarello

When using Vim you can find your <Leader> by using echo for the value of “mapleader”, however there are some edge cases that make this less than ideal. If “mapleader” is undefined an error is thrown instead of showing the default <Leader>. If “mapleader” is not a visible character (e.g. <Space> or <Tab>), you can not see the value. I use the following command to display <Leader> while working around these edge cases.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Draft, Solution Tagged With: vim

Vim, tmux, iTerm broken colors

Last updated on December 17, 2018 by Sal Ferrarello

I do most of my work in Vim (or Neovim) in tmux inside of iTerm on my Mac. I found my color schemes were being properly applied in Neovim but not in Vim (version 8). Adding two lines to my .vimrc corrected the problem for me.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Computing, Dev Tips, Draft, Solution Tagged With: tmux, vim

  • Go to page 1
  • Go to page 2
  • Next Page»

Copyright © 2023 · Bootstrap4 Genesis on Genesis Framework · WordPress · Log in