Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions lua/lq/plugins/linter.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
return {
{
"mfussenegger/nvim-lint",
config = function()
require("lint").linters_by_ft = {
python = { "pylint" },
}
-- require("lint").linters.pylint = {
-- cmd = "pylint",
-- stdin = true, -- or false if it doesn't support content input via stdin. In that case the filename is automatically added to the arguments.
-- append_fname = true, -- Automatically append the file name to `args` if `stdin = false` (default: true)
-- args = {}, -- list of arguments. Can contain functions with zero arguments that will be evaluated once the linter is used.
-- stream = nil, -- ('stdout' | 'stderr' | 'both') configure the stream to which the linter outputs the linting result.
-- ignore_exitcode = false, -- set this to true if the linter exits with a code != 0 and that's considered normal.
-- env = nil, -- custom environment table to use with the external process. Note that this replaces the *entire* environment, it is not additive.
-- -- parser = your_parse_function,
-- }
end,
},
}
10 changes: 9 additions & 1 deletion plugin/autocmds.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
vim.cmd([[ au TermOpen term://* setlocal nonumber norelativenumber ]])

-- Open a file from its last left off position
vim.cmd([[ au BufReadPost * if expand('%:p') !~# '\m/\.git/' && line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif ]])
vim.cmd(
[[ au BufReadPost * if expand('%:p') !~# '\m/\.git/' && line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif ]]
)
-- File extension specific tabbing
-- vim.cmd [[ autocmd Filetype python setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4 ]]

Expand Down Expand Up @@ -47,3 +49,9 @@ vim.cmd([[
autocmd Filetype markdown inoremap <buffer> ,l --------<Enter>
autocmd Filetype markdown inoremap <buffer> ,w <details><Enter><summary></summary><Enter><Enter><++><Enter></details><Esc>3ki
]])

vim.api.nvim_create_autocmd({ "BufWritePost" }, {
callback = function()
require("lint").try_lint()
end,
})