nvim: after/ftplugin: Move from vim to lua
This commit is contained in:
parent
f4d02a793f
commit
2d5fac776a
34 changed files with 78 additions and 50 deletions
2
nvim/.config/nvim/after/ftplugin/config.lua
Normal file
2
nvim/.config/nvim/after/ftplugin/config.lua
Normal file
|
@ -0,0 +1,2 @@
|
|||
vim.bo.textwidth = 0
|
||||
vim.bo.wrapmargin = 0
|
|
@ -1,2 +0,0 @@
|
|||
setlocal textwidth=0
|
||||
setlocal wrapmargin=0
|
4
nvim/.config/nvim/after/ftplugin/diff.lua
Normal file
4
nvim/.config/nvim/after/ftplugin/diff.lua
Normal file
|
@ -0,0 +1,4 @@
|
|||
vim.bo.spell = false
|
||||
|
||||
vim.keymap.set('n', '[c', "?^@@<CR>", { noremap=true, silent=true, buffer=0 })
|
||||
vim.keymap.set('n', ']c', "/^@@<CR>", { noremap=true, silent=true, buffer=0 })
|
|
@ -1,5 +0,0 @@
|
|||
setlocal nospell
|
||||
|
||||
" Jump to sections of diff
|
||||
nnoremap <buffer> [c ?^@@<CR>
|
||||
nnoremap <buffer> ]c /^@@<CR>
|
6
nvim/.config/nvim/after/ftplugin/dockerfile.lua
Normal file
6
nvim/.config/nvim/after/ftplugin/dockerfile.lua
Normal file
|
@ -0,0 +1,6 @@
|
|||
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
||||
buffer = 0,
|
||||
callback = function()
|
||||
require("lint").try_lint()
|
||||
end,
|
||||
})
|
|
@ -1 +0,0 @@
|
|||
autocmd! BufWritePost <buffer> lua require('lint').try_lint()
|
8
nvim/.config/nvim/after/ftplugin/fish.lua
Normal file
8
nvim/.config/nvim/after/ftplugin/fish.lua
Normal file
|
@ -0,0 +1,8 @@
|
|||
vim.keymap.set('n', 'gq', ":%!fish_indent %<CR>:w<CR>", { noremap=true, silent=true, buffer=0 })
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
||||
buffer = 0,
|
||||
callback = function()
|
||||
require("lint").try_lint()
|
||||
end,
|
||||
})
|
|
@ -1,3 +0,0 @@
|
|||
nnoremap <buffer> gq :silent :%!fish_indent %<CR>:w<CR>
|
||||
|
||||
autocmd! BufWritePost <buffer> lua require('lint').try_lint()
|
1
nvim/.config/nvim/after/ftplugin/fugitiveblame.lua
Normal file
1
nvim/.config/nvim/after/ftplugin/fugitiveblame.lua
Normal file
|
@ -0,0 +1 @@
|
|||
vim.keymap.set('n', 'q', ":bwipeout!<CR>", { noremap=true, silent=true, buffer=0 })
|
|
@ -1 +0,0 @@
|
|||
nnoremap <buffer> <silent> q :bwipeout!<CR>
|
5
nvim/.config/nvim/after/ftplugin/gitcommit.lua
Normal file
5
nvim/.config/nvim/after/ftplugin/gitcommit.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
vim.bo.textwidth = 72
|
||||
vim.bo.bufhidden = 'wipe'
|
||||
|
||||
vim.keymap.set('n', '[c', "?^@@<CR>", { noremap=true, silent=true, buffer=0 })
|
||||
vim.keymap.set('n', ']c', "/^@@<CR>", { noremap=true, silent=true, buffer=0 })
|
|
@ -1,7 +0,0 @@
|
|||
setlocal textwidth=72
|
||||
setlocal iskeyword+=-
|
||||
setlocal bufhidden=wipe
|
||||
|
||||
" Jump to sections of diff
|
||||
nnoremap <buffer> [c ?^@@<CR>
|
||||
nnoremap <buffer> ]c /^@@<CR>
|
1
nvim/.config/nvim/after/ftplugin/gitconfig.lua
Normal file
1
nvim/.config/nvim/after/ftplugin/gitconfig.lua
Normal file
|
@ -0,0 +1 @@
|
|||
vim.bo.bufhidden = 'wipe'
|
|
@ -1 +0,0 @@
|
|||
setlocal bufhidden=wipe
|
3
nvim/.config/nvim/after/ftplugin/help.lua
Normal file
3
nvim/.config/nvim/after/ftplugin/help.lua
Normal file
|
@ -0,0 +1,3 @@
|
|||
vim.bo.bufhidden = 'wipe'
|
||||
|
||||
vim.keymap.set('n', 'q', ":bwipeout!<CR>", { noremap=true, silent=true, buffer=0 })
|
|
@ -1,2 +0,0 @@
|
|||
setlocal bufhidden=wipe
|
||||
nnoremap <buffer> <silent>q :bwipeout!<CR>
|
1
nvim/.config/nvim/after/ftplugin/json.lua
Normal file
1
nvim/.config/nvim/after/ftplugin/json.lua
Normal file
|
@ -0,0 +1 @@
|
|||
vim.keymap.set('n', 'gq', ":%!jq '.'<CR>", { noremap=true, silent=true, buffer=0 })
|
|
@ -1 +0,0 @@
|
|||
nnoremap <buffer> gq :silent %!jq '.'<CR>
|
6
nvim/.config/nvim/after/ftplugin/lua.lua
Normal file
6
nvim/.config/nvim/after/ftplugin/lua.lua
Normal file
|
@ -0,0 +1,6 @@
|
|||
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
||||
buffer = 0,
|
||||
callback = function()
|
||||
require("lint").try_lint()
|
||||
end,
|
||||
})
|
|
@ -1 +0,0 @@
|
|||
autocmd! BufWritePost <buffer> lua require('lint').try_lint()
|
2
nvim/.config/nvim/after/ftplugin/man.lua
Normal file
2
nvim/.config/nvim/after/ftplugin/man.lua
Normal file
|
@ -0,0 +1,2 @@
|
|||
vim.bo.bufhidden = 'wipe'
|
||||
vim.bo.buflisted = false
|
|
@ -1,2 +0,0 @@
|
|||
setlocal bufhidden=wipe
|
||||
setlocal nobuflisted
|
6
nvim/.config/nvim/after/ftplugin/markdown.lua
Normal file
6
nvim/.config/nvim/after/ftplugin/markdown.lua
Normal file
|
@ -0,0 +1,6 @@
|
|||
vim.bo.textwidth = 80
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
||||
buffer = 0,
|
||||
command = 'Vale',
|
||||
})
|
|
@ -1,3 +0,0 @@
|
|||
setlocal textwidth=80
|
||||
|
||||
autocmd! BufWritePost <buffer> :Vale
|
2
nvim/.config/nvim/after/ftplugin/meson.lua
Normal file
2
nvim/.config/nvim/after/ftplugin/meson.lua
Normal file
|
@ -0,0 +1,2 @@
|
|||
vim.bo.textwidth = 0
|
||||
vim.bo.wrapmargin = 0
|
|
@ -1,2 +0,0 @@
|
|||
setlocal textwidth=0
|
||||
setlocal wrapmargin=0
|
2
nvim/.config/nvim/after/ftplugin/purescript.lua
Normal file
2
nvim/.config/nvim/after/ftplugin/purescript.lua
Normal file
|
@ -0,0 +1,2 @@
|
|||
vim.bo.textwidth = 0
|
||||
vim.bo.wrapmargin = 0
|
|
@ -1,2 +0,0 @@
|
|||
setlocal textwidth=0
|
||||
setlocal wrapmargin=0
|
|
@ -21,3 +21,15 @@ vim.lsp.start({
|
|||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.bo.textwidth = 0
|
||||
vim.bo.formatprg = "black -q -"
|
||||
|
||||
vim.keymap.set('n', 'gq', "ggVGgq<C-o><C-o>", { noremap=true, silent=true, buffer=0 })
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
||||
buffer = 0,
|
||||
callback = function()
|
||||
require("lint").try_lint()
|
||||
end,
|
||||
})
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
setlocal textwidth=0
|
||||
setlocal formatprg=black\ -q\ -
|
||||
|
||||
nnoremap <buffer> <silent> gq ggVGgq<C-o><C-o>
|
||||
|
||||
autocmd! BufWritePost <buffer> lua require('lint').try_lint()
|
|
@ -16,3 +16,19 @@ vim.lsp.start({
|
|||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.cmd.compiler('cargo')
|
||||
vim.bo.makeprg = 'cargo build --all'
|
||||
|
||||
vim.keymap.set('n', 'cbb', ":Dispatch! cargo build<CR>" , { noremap=true, buffer=0 })
|
||||
vim.keymap.set('n', 'cbc', ":Dispatch! cargo clean<CR>" , { noremap=true, buffer=0 })
|
||||
vim.keymap.set('n', 'cbd', ":Dispatch! cargo doc<CR>" , { noremap=true, buffer=0 })
|
||||
vim.keymap.set('n', 'cdD', ":Dispatch! cargo doc --open<CR>", { noremap=true, buffer=0 })
|
||||
vim.keymap.set('n', 'cbu', ":Dispatch! cargo update<CR>" , { noremap=true, buffer=0 })
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufWritePre" }, {
|
||||
buffer = 0,
|
||||
callback = function()
|
||||
vim.lsp.buf.format({async=true})
|
||||
end,
|
||||
})
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
compiler cargo
|
||||
setlocal makeprg=cargo\ build\ --all
|
||||
|
||||
nnoremap <buffer> cbb :Dispatch! cargo build<CR>
|
||||
nnoremap <buffer> cbc :Dispatch! cargo clean<CR>
|
||||
nnoremap <buffer> cbd :Dispatch! cargo doc<CR>
|
||||
nnoremap <buffer> cbD :Dispatch! cargo doc --open<CR>
|
||||
nnoremap <buffer> cbu :Dispatch! cargo update<CR>
|
||||
|
||||
autocmd! BufWritePre <buffer> :lua vim.lsp.buf.format({async=true})
|
1
nvim/.config/nvim/after/ftplugin/text.lua
Normal file
1
nvim/.config/nvim/after/ftplugin/text.lua
Normal file
|
@ -0,0 +1 @@
|
|||
vim.bo.textwidth = 80
|
|
@ -1 +0,0 @@
|
|||
setlocal textwidth=78
|
Loading…
Reference in a new issue