Skip to content

Instantly share code, notes, and snippets.

@przbadu
Last active April 7, 2022 07:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save przbadu/fbdeb1f95abc9dd4dfb7e04fa4a565f4 to your computer and use it in GitHub Desktop.
Save przbadu/fbdeb1f95abc9dd4dfb7e04fa4a565f4 to your computer and use it in GitHub Desktop.
Configure Nvim for Rails development

install nvcode

https://github.com/ChristianChiarulli/LunarVim

You can follow the steps in the README file, install required dependencies

Installing Plugins for Rails configuration

https://www.lunarvim.org/plugins/#installing

Open config.lua file, easy way is to open lvim editor and click on Configuration option from home page

Rails setup

-- Additional Plugins
lvim.plugins = {
  {"vim-test/vim-test"},
  {"tpope/vim-rails"}
}

-- VIM configurations (my custom configurations)
vim.o.relativenumber = true
-- vim-test keybindings
local map = vim.api.nvim_set_keymap
map('n', '<Leader>tf', ':TestFile<CR>', {silent = true})
map('n', '<Leader>tt', ':TestNearest<CR>', {silent = true})
map('n', '<Leader>ts', ':TestSuite<CR>', {silent = true})
map('n', '<Leader>tl', ':TestLast<CR>', {silent = true})
map('n', '<Leader>tg', ':TestVisit<CR>', {silent = true})

-- vim-test strategy
vim.g['test#strategy'] = 'neovim'
-- using neovim strategy, so that pressing anykey will not close test result window
vim.g['test#neovim#start_normal'] = 1

Installing Nerd Font in mac osx

brew tap homebrew/cask-fonts
brew install --cask font-fira-code-nerd-font

Manually

meslo is another great nerd font, you can download and install them

Download these four ttf files:

Once fira nerd font is installed, don't forget to change font for your terminal to Fira NF

Additional s/w

brew install ranger
brew install ripgrep
brew install the_silver_searcher
brew install ack
@przbadu
Copy link
Author

przbadu commented Apr 7, 2022

Alacritty configuration

font:
  size: 13
  normal:
    family: "MesloLGS NF"
shell:
  program: /usr/bin/zsh
  args:
    - --login

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment