Skip to content

Commit

Permalink
home-manager/neovim: move some extraConfig to extraLuaConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagokokada committed Nov 14, 2023
1 parent 7497c91 commit ff66955
Showing 1 changed file with 33 additions and 22 deletions.
55 changes: 33 additions & 22 deletions home-manager/editor/neovim.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,6 @@ in

extraConfig = /* vimscript */ ''
"" General config
" show line number
set number
" live substitutions as you type
set inccommand=nosplit
" copy and paste
set clipboard+=unnamedplus
" show vertical column
set colorcolumn=81,121
" turn on omnicomplete
set omnifunc=syntaxcomplete#Complete
Expand Down Expand Up @@ -89,9 +77,6 @@ in
nnoremap <C-k> <c-w>k
nnoremap <C-l> <c-w>l
" threat words with dash as a word
set iskeyword+=-
" completion
set completeopt=menu
inoremap <expr> <C-j> pumvisible() ? "\<C-n>" : "\<C-j>"
Expand All @@ -106,16 +91,38 @@ in
" disable "How to disable mouse" menu
aunmenu PopUp.How-to\ disable\ mouse
aunmenu PopUp.-1-
'';

extraLuaConfig = /* lua */ ''
" syntax highlight flake.lock files as json
autocmd BufNewFile,BufRead flake.lock set filetype=json
-- intentionally blank line to fix init.lua formatting
" keep comment leader when 'o' or 'O' is used in Normal mode
autocmd FileType * set formatoptions+=o
-- show line numbers
vim.opt.number = true
" disable netrw (we wil use lir-nvim instead)
let g:loaded_netrw = 1
let g:loaded_netrwPlugin = 1
-- live substitutions as you type
vim.opt.inccommand = 'nosplit'
-- copy and paste use the system clipboard
vim.opt.clipboard:append { 'unnamedplus' }
-- show vertical colum
vim.opt.colorcolumn:append { 81, 121 }
-- threat words-with-dash as a word
vim.opt.iskeyword:append { '-' }
-- syntax highlight flake.lock files as json
vim.api.nvim_create_autocmd({ 'BufNewFile', 'BufRead' }, {
pattern = 'flake.lock',
command = 'set filetype=json',
})
-- keep comment leader when 'o' or 'O' is used in Normal mode
vim.api.nvim_create_autocmd({ 'FileType' }, {
pattern = '*',
command = 'set formatoptions+=o',
})
'';

# To install non-packaged plugins, use
Expand Down Expand Up @@ -161,6 +168,10 @@ in
plugin = lir-nvim;
type = "lua";
config = /* lua */ ''
-- disable netrw
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
local actions = require('lir.actions')
local mark_actions = require('lir.mark.actions')
local clipboard_actions = require('lir.clipboard.actions')
Expand Down

0 comments on commit ff66955

Please sign in to comment.