comparison .chezmoitemplates/init.lua @ 582:8d5873878bb8

Add Cfd command to search files
author zegervdv <zegervdv@me.com>
date Sat, 09 Apr 2022 15:49:54 +0200
parents ea43c828daa1
children 9fab6a7e1c21
comparison
equal deleted inserted replaced
581:ea43c828daa1 582:8d5873878bb8
3 -- 3 --
4 -- 4 --
5 local execute = vim.api.nvim_command 5 local execute = vim.api.nvim_command
6 local fn = vim.fn 6 local fn = vim.fn
7 7
8 local home = os.getenv('HOME') 8 local home = os.getenv 'HOME'
9 if home == nil then 9 if home == nil then
10 home = os.getenv('USERPROFILE') 10 home = os.getenv 'USERPROFILE'
11 end 11 end
12 12
13 -- Bootstrap package manager 13 -- Bootstrap package manager
14 local install_path = fn.stdpath 'data' .. '/site/pack/packer/opt/packer.nvim' 14 local install_path = fn.stdpath 'data' .. '/site/pack/packer/opt/packer.nvim'
15 15
593 } 593 }
594 594
595 -- Filetypes 595 -- Filetypes
596 use { 'lepture/vim-jinja' } 596 use { 'lepture/vim-jinja' }
597 597
598 -- Integration with external tools 598 -- Integration with external tools
599 use { 599 use {
600 'glacambre/firenvim', 600 'glacambre/firenvim',
601 run = function() vim.fn['firenvim#install'](0) end, 601 run = function()
602 config = function () 602 vim.fn['firenvim#install'](0)
603 vim.g.firenvim_config = { 603 end,
604 localSettings = { 604 config = function()
605 ['.*'] = { 605 vim.g.firenvim_config = {
606 takeover = 'never', 606 localSettings = {
607 } 607 ['.*'] = {
608 } 608 takeover = 'never',
609 } 609 },
610 end, 610 },
611 } 611 }
612 612 end,
613 end) 613 }
614 end)
614 615
615 vim.cmd [[ packadd dirbuf.nvim ]] 616 vim.cmd [[ packadd dirbuf.nvim ]]
616 617
617 -- Configuration 618 -- Configuration
618 local opt = vim.opt 619 local opt = vim.opt
1003 end) 1004 end)
1004 end 1005 end
1005 1006
1006 vim.api.nvim_add_user_command('LspRename', LspRename, {}) 1007 vim.api.nvim_add_user_command('LspRename', LspRename, {})
1007 1008
1009 local fd_quickfix = function(args)
1010 local grepprg = vim.opt.grepprg
1011 local grepformat = vim.opt.grepformat
1012
1013 vim.opt.grepprg = 'fd'
1014 vim.opt.grepformat = '%f'
1015 vim.cmd('execute' .. '"silent! grep! ' .. args.args .. '"')
1016 vim.cmd 'copen'
1017
1018 vim.opt.grepprg = grepprg
1019 vim.opt.grepformat = grepformat
1020 end
1021 vim.api.nvim_add_user_command('Cfd', fd_quickfix, { nargs = '+', complete = 'file' })
1022
1008 vim.diagnostic.config { 1023 vim.diagnostic.config {
1009 underline = true, 1024 underline = true,
1010 update_in_insert = false, 1025 update_in_insert = false,
1011 virtual_text = { severity = { min = vim.diagnostic.severity.WARN }, source = 'always' }, 1026 virtual_text = { severity = { min = vim.diagnostic.severity.WARN }, source = 'always' },
1012 severity_sort = true, 1027 severity_sort = true,