[profiles/desktop] modify neovim config
This commit is contained in:
4
profiles/desktop/.config/nvim/after/ftplugin/bash.lua
Normal file
4
profiles/desktop/.config/nvim/after/ftplugin/bash.lua
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
-- set default tab width to 2 spaces
|
||||||
|
vim.opt_local.tabstop = 2 -- number of spaces that a tab counts for
|
||||||
|
vim.opt_local.shiftwidth = 2 -- size of an autoindented shift
|
||||||
|
vim.opt_local.softtabstop = 0 -- indentation size
|
||||||
4
profiles/desktop/.config/nvim/after/ftplugin/sh.lua
Normal file
4
profiles/desktop/.config/nvim/after/ftplugin/sh.lua
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
-- set default tab width to 2 spaces
|
||||||
|
vim.opt_local.tabstop = 2 -- number of spaces that a tab counts for
|
||||||
|
vim.opt_local.shiftwidth = 2 -- size of an autoindented shift
|
||||||
|
vim.opt_local.softtabstop = 0 -- indentation size
|
||||||
4
profiles/desktop/.config/nvim/after/ftplugin/zsh.lua
Normal file
4
profiles/desktop/.config/nvim/after/ftplugin/zsh.lua
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
-- set default tab width to 2 spaces
|
||||||
|
vim.opt_local.tabstop = 2 -- number of spaces that a tab counts for
|
||||||
|
vim.opt_local.shiftwidth = 2 -- size of an autoindented shift
|
||||||
|
vim.opt_local.softtabstop = 0 -- indentation size
|
||||||
@@ -94,8 +94,3 @@ vim.opt.cinoptions:append({ 'N-s' })
|
|||||||
vim.g.html_indent_autotags = 'html,thead,tbody,tfoot'
|
vim.g.html_indent_autotags = 'html,thead,tbody,tfoot'
|
||||||
vim.g.html_indent_script1 = 'auto'
|
vim.g.html_indent_script1 = 'auto'
|
||||||
vim.g.html_indent_style1 = 'auto'
|
vim.g.html_indent_style1 = 'auto'
|
||||||
|
|
||||||
-- set cursor shape to underline in the normal and command mode,
|
|
||||||
-- in the insert mode change shape to vertical bar, and disable
|
|
||||||
-- blinking in all modes
|
|
||||||
-- vim.opt.guicursor:append({ 'n-c:hor20', 'i:ver20', 'a:blinkon0' })
|
|
||||||
|
|||||||
@@ -4,6 +4,26 @@ return {
|
|||||||
config = function()
|
config = function()
|
||||||
local conform = require('conform')
|
local conform = require('conform')
|
||||||
|
|
||||||
|
local formatters = {
|
||||||
|
stylua = {},
|
||||||
|
clang_format = {},
|
||||||
|
prettier = {},
|
||||||
|
autopep8 = {},
|
||||||
|
isort = {},
|
||||||
|
shfmt = {},
|
||||||
|
}
|
||||||
|
|
||||||
|
local util = require('conform.util')
|
||||||
|
for _, formatter in pairs(formatters) do
|
||||||
|
formatter.cwd = util.root_file({
|
||||||
|
'.git',
|
||||||
|
'pyproject.toml',
|
||||||
|
'package.json',
|
||||||
|
'Makefile',
|
||||||
|
'.editorconfig',
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
conform.setup({
|
conform.setup({
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
lua = { 'stylua' },
|
lua = { 'stylua' },
|
||||||
@@ -13,12 +33,11 @@ return {
|
|||||||
css = { 'prettier' },
|
css = { 'prettier' },
|
||||||
javascript = { 'prettier' },
|
javascript = { 'prettier' },
|
||||||
python = { 'autopep8', 'isort' },
|
python = { 'autopep8', 'isort' },
|
||||||
bash = { 'beautysh' },
|
bash = { 'shfmt' },
|
||||||
csh = { 'beautysh' },
|
ksh = { 'shfmt' },
|
||||||
ksh = { 'beautysh' },
|
sh = { 'shfmt' },
|
||||||
sh = { 'beautysh' },
|
|
||||||
zsh = { 'beautysh' },
|
|
||||||
},
|
},
|
||||||
|
formatters = formatters,
|
||||||
-- format_on_save = {
|
-- format_on_save = {
|
||||||
-- lsp_fallback = true,
|
-- lsp_fallback = true,
|
||||||
-- async = false,
|
-- async = false,
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ return {
|
|||||||
require('mason-lspconfig').setup({
|
require('mason-lspconfig').setup({
|
||||||
automatic_enable = true,
|
automatic_enable = true,
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.lsp.config('*', {
|
vim.lsp.config('*', {
|
||||||
capabilities = {
|
capabilities = {
|
||||||
textDocument = {
|
textDocument = {
|
||||||
|
|||||||
Reference in New Issue
Block a user