feat(nvim): add css linting and language specific tab space

This commit is contained in:
matt1432 2023-10-20 21:06:44 -04:00
parent 687993617d
commit 044362378a
3 changed files with 41 additions and 4 deletions

View file

@ -1,9 +1,19 @@
" make tabs only 2 spaces
set tabstop=2
set shiftwidth=2
set expandtab
set smartindent set smartindent
" by default, the indent is 2 spaces.
set shiftwidth=2
set softtabstop=2
set tabstop=2
" for html/rb files, 2 spaces
autocmd Filetype html setlocal ts=2 sw=2 expandtab
autocmd Filetype ruby setlocal ts=2 sw=2 expandtab
" for js/coffee/jade files, 4 spaces
autocmd Filetype javascript setlocal ts=4 sw=4 sts=0 expandtab
autocmd Filetype coffeescript setlocal ts=4 sw=4 sts=0 expandtab
autocmd Filetype jade setlocal ts=4 sw=4 sts=0 expandtab
set number set number
set relativenumber set relativenumber

View file

@ -55,7 +55,15 @@ in
settings = { settings = {
"colors.enable" = true; "colors.enable" = true;
"coc.preferences.formatOnType" = true; "coc.preferences.formatOnType" = true;
"eslint.format.enable" = true; "eslint.format.enable" = true;
"eslint.autoFixOnSave" = true;
"stylelintplus.autoFixOnFormat" = true;
"css.validate" = false;
"less.validate" = false;
"scss.validate" = false;
"wxss.validate" = false;
"Lua.misc.parameters" = [ "Lua.misc.parameters" = [
"--metapath" "--metapath"
"~/.cache/sumneko_lua/meta" "~/.cache/sumneko_lua/meta"
@ -69,6 +77,7 @@ in
serverDir = "${pkgs.lua-language-server}/share/lua-language-server"; serverDir = "${pkgs.lua-language-server}/share/lua-language-server";
enableNvimLuaDev = true; enableNvimLuaDev = true;
}; };
"java.jdt.ls.java.home" = "${pkgs.temurin-bin-17}"; "java.jdt.ls.java.home" = "${pkgs.temurin-bin-17}";
"bashIde.shellcheckPath" = "${pkgs.shellcheck}/bin/shellcheck"; "bashIde.shellcheckPath" = "${pkgs.shellcheck}/bin/shellcheck";
languageserver = { languageserver = {
@ -98,6 +107,10 @@ in
coc-markdownlint coc-markdownlint
coc-tsserver coc-tsserver
coc-eslint coc-eslint
(plugin "bmatcuk"
"coc-stylelintplus"
"4854bfdc0cb6f92e39b5afb3b90d60b411ecb9e4"
"sha256-PgcQc3JecfHE4oNcydyOqsKdRbh4yPhXPugVQDGSRuI=")
neodev-nvim neodev-nvim
coc-fzf coc-fzf

View file

@ -0,0 +1,14 @@
extends: stylelint-config-standard-scss
ignoreFiles: "**/*.js"
rules:
selector-type-no-unknown: null
declaration-empty-line-before: null
no-descending-specificity: null
selector-pseudo-class-no-unknown: null
color-function-notation: legacy
alpha-value-notation: number
scss/operator-no-unspaced: null
scss/no-global-function-names: null
scss/dollar-variable-empty-line-before: null
scss/dollar-variable-pattern: ^[a-z]+(_[a-z]+)*$
scss/at-mixin-pattern: ^[a-z]+(_[a-z]+)*$