mirror of
https://git.disroot.org/FollieHiyuki/dotfiles.git
synced 2024-11-24 16:28:22 -05:00
neovim
- plugins: add dial.nvim, remove spellsitter.nvim - null-ls.nvim: make a list of interesting linters/formatters - chore: add luacheck
This commit is contained in:
parent
12b240dc21
commit
ceb46755cd
3
home/.config/nvim/.luacheckrc
Normal file
3
home/.config/nvim/.luacheckrc
Normal file
@ -0,0 +1,3 @@
|
||||
std = 'min'
|
||||
cache = true
|
||||
new_globals = {'vim'}
|
@ -8,7 +8,7 @@ local function pandoc_convert(ofiletype)
|
||||
|
||||
local ifilename = vim.fn.expand('%:p')
|
||||
local ofilename = vim.fn.expand('%:p:r') .. '.' .. ofiletype
|
||||
local cmd = nil
|
||||
local cmd
|
||||
|
||||
if ofiletype == 'pdf' then
|
||||
cmd = string.format('pandoc %s -o %s --pdf-engine=xelatex -V "mainfont:Iosevka Etoile" -V "sansfont:Iosevka Aile" -V "monofont:Iosevka" -V "geometry:margin=1in"', ifilename, ofilename)
|
||||
|
@ -138,13 +138,6 @@ function M.treesitter_conf()
|
||||
vim.opt.foldexpr = 'nvim_treesitter#foldexpr()'
|
||||
end
|
||||
|
||||
-- function M.spellsitter_conf()
|
||||
-- require('spellsitter').setup {
|
||||
-- hl = 'SpellBad',
|
||||
-- captures = {'comment'}
|
||||
-- }
|
||||
-- end
|
||||
|
||||
function M.iswap_conf()
|
||||
require('iswap').setup {
|
||||
-- The keys that will be used as a selection, in order
|
||||
@ -259,6 +252,60 @@ function M.eft_conf()
|
||||
vim.api.nvim_set_keymap('x', ';', '<Plug>(eft-repeat)', {})
|
||||
end
|
||||
|
||||
function M.dial_conf()
|
||||
local dial = require('dial')
|
||||
|
||||
-- Custom augends
|
||||
dial.augends['custom#boolean'] = dial.common.enum_cyclic{
|
||||
name = 'boolean',
|
||||
strlist = {'true', 'false'}
|
||||
}
|
||||
dial.augends['custom#boolean2'] = dial.common.enum_cyclic{
|
||||
name = 'boolean',
|
||||
strlist = {'True', 'False'}
|
||||
}
|
||||
|
||||
dial.config.searchlist.normal = {
|
||||
'number#decimal#int',
|
||||
'number#decimal#fixed#zero',
|
||||
'number#hex',
|
||||
'number#binary',
|
||||
'date#[%Y/%m/%d]',
|
||||
'date#[%m/%d]',
|
||||
'date#[%Y-%m-%d]',
|
||||
'date#[%H:%M:%S]',
|
||||
'date#[%H:%M]',
|
||||
'date#[%jA]',
|
||||
'color#hex',
|
||||
'markup#markdown#header',
|
||||
'custom#boolean',
|
||||
'custom#boolean2'
|
||||
}
|
||||
dial.config.searchlist.visual = {
|
||||
'number#decimal#int',
|
||||
'number#decimal#fixed#zero',
|
||||
'number#hex',
|
||||
'number#binary',
|
||||
'date#[%Y/%m/%d]',
|
||||
'date#[%m/%d]',
|
||||
'date#[%Y-%m-%d]',
|
||||
'date#[%H:%M:%S]',
|
||||
'date#[%H:%M]',
|
||||
'date#[%jA]',
|
||||
'char#alph#small#word',
|
||||
'char#alph#capital#word',
|
||||
'color#hex'
|
||||
}
|
||||
|
||||
-- Mappings
|
||||
vim.api.nvim_set_keymap('n', '<C-a>', '<Plug>(dial-increment)', {})
|
||||
vim.api.nvim_set_keymap('v', '<C-a>', '<Plug>(dial-increment)', {})
|
||||
vim.api.nvim_set_keymap('n', '<C-x>', '<Plug>(dial-decrement)', {})
|
||||
vim.api.nvim_set_keymap('v', '<C-x>', '<Plug>(dial-decrement)', {})
|
||||
vim.api.nvim_set_keymap('v', 'g<C-a>', '<Plug>(dial-increment-additional)', {})
|
||||
vim.api.nvim_set_keymap('v', 'g<C-x>', '<Plug>(dial-decrement-additional)', {})
|
||||
end
|
||||
|
||||
function M.comment_conf()
|
||||
require('nvim_comment').setup {comment_empty = false}
|
||||
end
|
||||
|
@ -305,16 +305,97 @@ function M.lsp_conf()
|
||||
-- Register sources
|
||||
null_ls.config {
|
||||
sources = {
|
||||
-- Formatters
|
||||
null_ls.builtins.formatting.stylua.with {
|
||||
condition = function(utils)
|
||||
return utils.root_has_file('stylua.toml')
|
||||
end
|
||||
},
|
||||
-- Formatters --
|
||||
-- null_ls.builtins.formatting.black.with {
|
||||
-- command = 'black'
|
||||
-- },
|
||||
null_ls.builtins.formatting.clang_format.with {
|
||||
filetypes = {'c', 'cpp'}
|
||||
}
|
||||
-- Linters
|
||||
},
|
||||
-- null_ls.builtins.formatting.cmake_format.with {
|
||||
-- command = 'cmake-format'
|
||||
-- },
|
||||
-- null_ls.builtins.formatting.eslint.with {
|
||||
-- condition = function(utils)
|
||||
-- return utils.root_has_file('.eslintrc.js')
|
||||
-- end,
|
||||
-- command = 'eslint'
|
||||
-- },
|
||||
null_ls.builtins.formatting.fish_indent,
|
||||
-- null_ls.builtins.formatting.fixjson.with {
|
||||
-- command = 'fixjson'
|
||||
-- },
|
||||
-- null_ls.builtins.formatting.fnlfmt.with {
|
||||
-- command = 'fnlfmt'
|
||||
-- },
|
||||
-- null_ls.builtins.formatting.goimports.with {
|
||||
-- command = 'goimports'
|
||||
-- },
|
||||
-- null_ls.builtins.formatting.gofmt.with {
|
||||
-- command = 'gofmt'
|
||||
-- },
|
||||
-- null_ls.builtins.formatting.isort.with {
|
||||
-- command = 'isort'
|
||||
-- },
|
||||
-- null_ls.builtins.formatting.nixfmt.with {
|
||||
-- command = 'nixfmt'
|
||||
-- },
|
||||
-- null_ls.builtins.formatting.prettier.with {
|
||||
-- command = 'prettier'
|
||||
-- },
|
||||
-- null_ls.builtins.formatting.rustfmt.with {
|
||||
-- command = 'rustfmt'
|
||||
-- },
|
||||
-- null_ls.builtins.formatting.rustywind.with {
|
||||
-- command = 'rustywind'
|
||||
-- },
|
||||
-- null_ls.builtins.formatting.shfmt,
|
||||
-- null_ls.builtins.formatting.stylua.with {
|
||||
-- condition = function(utils)
|
||||
-- return utils.root_has_file('stylua.toml')
|
||||
-- end,
|
||||
-- command = 'stylua'
|
||||
-- },
|
||||
-- null_ls.builtins.formatting.uncrustify.with {
|
||||
-- command = 'uncrustify'
|
||||
-- },
|
||||
-- null_ls.builtins.formatting.yapf.with {
|
||||
-- command = 'yapf'
|
||||
-- },
|
||||
-- null_ls.builtins.formatting.autopep8.with {
|
||||
-- command = 'autopep8'
|
||||
-- },
|
||||
-- null_ls.builtins.formatting.stylelint.with {
|
||||
-- command = 'stylelint'
|
||||
-- },
|
||||
-- Linters --
|
||||
null_ls.builtins.diagnostics.shellcheck,
|
||||
-- null_ls.builtins.diagnostics.codespell.with {
|
||||
-- command = 'codespell'
|
||||
-- },
|
||||
-- null_ls.builtins.diagnostics.eslint.with {
|
||||
-- command = 'eslint'
|
||||
-- },
|
||||
-- null_ls.builtins.diagnostics.flake8.with {
|
||||
-- command = 'flake8'
|
||||
-- },
|
||||
null_ls.builtins.diagnostics.hadolint.with {
|
||||
command = vim.fn.stdpath('config') .. '/scripts/hadolint',
|
||||
args = {'$FILENAME'}
|
||||
},
|
||||
null_ls.builtins.diagnostics.luacheck,
|
||||
-- null_ls.builtins.diagnostics.cppcheck,
|
||||
-- null_ls.builtins.diagnostics.write_good,
|
||||
-- null_ls.builtins.diagnostics.proselint,
|
||||
-- null_ls.builtins.diagnostics.markdownlint,
|
||||
-- null_ls.builtins.diagnostics.pylint,
|
||||
-- null_ls.builtins.diagnostics.vale,
|
||||
-- null_ls.builtins.diagnostics.misspell,
|
||||
-- null_ls.builtins.diagnostics.vint,
|
||||
-- null_ls.builtins.diagnostics.stylelint,
|
||||
-- Special --
|
||||
null_ls.builtins.hover.dictionary, -- get word definition from dictionaryapi.dev
|
||||
-- null_ls.builtins.code_actions.gitsigns
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,6 @@ local M = {}
|
||||
|
||||
function M.dashboard_conf()
|
||||
local dashboard = require('alpha.themes.dashboard')
|
||||
local button = dashboard.button
|
||||
|
||||
dashboard.section.header = {
|
||||
type = 'text',
|
||||
@ -32,7 +31,7 @@ function M.dashboard_conf()
|
||||
}
|
||||
}
|
||||
|
||||
button = function(sc, txt, keybind, keybind_opts)
|
||||
local button = function(sc, txt, keybind, keybind_opts)
|
||||
local sc_ = sc:gsub('%s', ''):gsub('SPC', '<leader>')
|
||||
|
||||
local opts = {
|
||||
|
@ -78,11 +78,6 @@ return packer.startup(function(use)
|
||||
use {'nvim-treesitter/playground', after = 'nvim-treesitter'}
|
||||
use {'romgrk/nvim-treesitter-context', after = 'nvim-treesitter'}
|
||||
use {'nvim-treesitter/nvim-treesitter-textobjects', after = 'nvim-treesitter'}
|
||||
-- use {
|
||||
-- 'lewis6991/spellsitter.nvim',
|
||||
-- event = {'BufRead', 'BufNew', 'BufNewFile'},
|
||||
-- config = editor.spellsitter_conf
|
||||
-- }
|
||||
use {
|
||||
'lukas-reineke/indent-blankline.nvim',
|
||||
after = 'nvim-treesitter',
|
||||
@ -137,6 +132,14 @@ return packer.startup(function(use)
|
||||
},
|
||||
config = editor.eft_conf
|
||||
}
|
||||
use {
|
||||
'monaqa/dial.nvim',
|
||||
keys = {
|
||||
{'n', '<C-a>'}, {'v', '<C-a>'}, {'v', 'g<C-a>'},
|
||||
{'n', '<C-x>'}, {'v', '<C-x>'}, {'v', 'g<C-x>'}
|
||||
},
|
||||
config = editor.dial_conf
|
||||
}
|
||||
use {'junegunn/vim-easy-align', cmd = 'EasyAlign'}
|
||||
use {
|
||||
'terrortylor/nvim-comment',
|
||||
@ -433,9 +436,9 @@ return packer.startup(function(use)
|
||||
}
|
||||
use {'dstein64/vim-startuptime', cmd = 'StartupTime'} -- Just for benchmarking
|
||||
|
||||
-- TODO: dial.nvim, rust-tools.nvim, crates.nvim, go.nvim, clojure-vim/*,
|
||||
-- nvim-bqf, nvim-comment-frame, nvim-revJ.lua, nvim-remote-containers,
|
||||
-- tex.nvim, telescope-lsp-handlers.nvim, telescope-dap.nvim
|
||||
-- TODO: rust-tools.nvim, crates.nvim, go.nvim, clojure-vim/*, nvim-bqf,
|
||||
-- nvim-comment-frame, nvim-revJ.lua, nvim-remote-containers, tex.nvim,
|
||||
-- telescope-lsp-handlers.nvim, telescope-dap.nvim
|
||||
|
||||
-- Install plugins if missing
|
||||
packer.install()
|
||||
|
4
home/.config/nvim/scripts/hadolint
Executable file
4
home/.config/nvim/scripts/hadolint
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
podman run --rm -i docker.io/hadolint/hadolint \
|
||||
hadolint --no-fail --format=json - < "$@"
|
3
home/.config/nvim/scripts/lint/hadolint
Executable file
3
home/.config/nvim/scripts/lint/hadolint
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
podman pull docker.io/hadolint/hadolint:latest
|
Loading…
Reference in New Issue
Block a user