nvim: after/ftplugin: Move from vim to lua

This commit is contained in:
Sanchayan Maity 2023-01-12 14:45:27 +05:30
parent f4d02a793f
commit 2d5fac776a
Signed by: sanchayanmaity
GPG key ID: 6F6A0609C12038F3
34 changed files with 78 additions and 50 deletions

View file

@ -0,0 +1,2 @@
vim.bo.textwidth = 0
vim.bo.wrapmargin = 0

View file

@ -1,2 +0,0 @@
setlocal textwidth=0
setlocal wrapmargin=0

View 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 })

View file

@ -1,5 +0,0 @@
setlocal nospell
" Jump to sections of diff
nnoremap <buffer> [c ?^@@<CR>
nnoremap <buffer> ]c /^@@<CR>

View file

@ -0,0 +1,6 @@
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
buffer = 0,
callback = function()
require("lint").try_lint()
end,
})

View file

@ -1 +0,0 @@
autocmd! BufWritePost <buffer> lua require('lint').try_lint()

View 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,
})

View file

@ -1,3 +0,0 @@
nnoremap <buffer> gq :silent :%!fish_indent %<CR>:w<CR>
autocmd! BufWritePost <buffer> lua require('lint').try_lint()

View file

@ -0,0 +1 @@
vim.keymap.set('n', 'q', ":bwipeout!<CR>", { noremap=true, silent=true, buffer=0 })

View file

@ -1 +0,0 @@
nnoremap <buffer> <silent> q :bwipeout!<CR>

View 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 })

View file

@ -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>

View file

@ -0,0 +1 @@
vim.bo.bufhidden = 'wipe'

View file

@ -1 +0,0 @@
setlocal bufhidden=wipe

View file

@ -0,0 +1,3 @@
vim.bo.bufhidden = 'wipe'
vim.keymap.set('n', 'q', ":bwipeout!<CR>", { noremap=true, silent=true, buffer=0 })

View file

@ -1,2 +0,0 @@
setlocal bufhidden=wipe
nnoremap <buffer> <silent>q :bwipeout!<CR>

View file

@ -0,0 +1 @@
vim.keymap.set('n', 'gq', ":%!jq '.'<CR>", { noremap=true, silent=true, buffer=0 })

View file

@ -1 +0,0 @@
nnoremap <buffer> gq :silent %!jq '.'<CR>

View file

@ -0,0 +1,6 @@
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
buffer = 0,
callback = function()
require("lint").try_lint()
end,
})

View file

@ -1 +0,0 @@
autocmd! BufWritePost <buffer> lua require('lint').try_lint()

View file

@ -0,0 +1,2 @@
vim.bo.bufhidden = 'wipe'
vim.bo.buflisted = false

View file

@ -1,2 +0,0 @@
setlocal bufhidden=wipe
setlocal nobuflisted

View file

@ -0,0 +1,6 @@
vim.bo.textwidth = 80
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
buffer = 0,
command = 'Vale',
})

View file

@ -1,3 +0,0 @@
setlocal textwidth=80
autocmd! BufWritePost <buffer> :Vale

View file

@ -0,0 +1,2 @@
vim.bo.textwidth = 0
vim.bo.wrapmargin = 0

View file

@ -1,2 +0,0 @@
setlocal textwidth=0
setlocal wrapmargin=0

View file

@ -0,0 +1,2 @@
vim.bo.textwidth = 0
vim.bo.wrapmargin = 0

View file

@ -1,2 +0,0 @@
setlocal textwidth=0
setlocal wrapmargin=0

View file

@ -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,
})

View file

@ -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()

View file

@ -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,
})

View file

@ -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})

View file

@ -0,0 +1 @@
vim.bo.textwidth = 80

View file

@ -1 +0,0 @@
setlocal textwidth=78