Skip to content

Commit

Permalink
chore
Browse files Browse the repository at this point in the history
  • Loading branch information
lttr committed Nov 8, 2022
1 parent d78a981 commit 8bd3162
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 81 deletions.
26 changes: 7 additions & 19 deletions aliases
Original file line number Diff line number Diff line change
Expand Up @@ -81,30 +81,18 @@ alias sand="cd ~/sandbox"
# npm
# =================================================================

alias nr="npm run"
alias ns="npm start"

alias nb="npm run build"
alias build="npm run build"

alias nd="npm run dev"
alias dev="npm run dev"

alias nli="npm run lint"
alias lint="npm run lint"

alias ni="npm install"
alias nid="npm install --save-dev"
alias nl="npm run lint"
alias nr="npm run"
alias ns="npm start"
alias nse="npm run serve"
alias serve="npm run serve"
alias server="npm run server"

alias nw="npm run watch"
alias nt="npm run --silent test"
alias ni="npm install"
alias nuni="npm uninstall"
alias nid="npm install --save-dev"
alias nig="npm install -g"

alias sb="npm run storybook"
alias nv="npm run validate"
alias nw="npm run watch"

alias pn="pnpm"

Expand Down
7 changes: 2 additions & 5 deletions bootstrap/configuration/customInstalls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,15 @@ const voltaPackages = [
"git-standup",
"hygen",
"json",
"luafmt",
"lua-fmt",
"netlify",
"node",
"npm-why",
"nx",
"open-cli",
"pnpm",
"pollinate",
"prettier",
"prettierd",
"@fsouza/prettierd",
"stylelint",
"tsserver",
"typescript-language-server",
];

Expand Down
36 changes: 29 additions & 7 deletions nvim/after/plugin/null-ls.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,39 +16,61 @@ null_ls.setup {
null_ls.builtins.formatting.prettierd.with(
{
condition = function(utils)
return not utils.root_has_file({"deno.json"})
return not utils.root_has_file({ "deno.json" })
end
}
),
null_ls.builtins.formatting.deno_fmt.with(
{
condition = function(utils)
return utils.root_has_file({"deno.json"})
return utils.root_has_file({ "deno.json" })
end
}
),
null_ls.builtins.formatting.eslint_d,
-- null_ls.builtins.formatting.stylelint,
null_ls.builtins.formatting.lua_format
null_ls.builtins.formatting.stylelint.with(
{
filetypes = { "scss", "less", "css", "sass", "vue" }
}
),
null_ls.builtins.formatting.lua_format,
--
-- Linting / diagnostics
--
-- These are run as language servers
-- Others are run as language servers
null_ls.builtins.diagnostics.eslint_d.with(
{
-- ignore prettier warnings from eslint-plugin-prettier
filter = function(diagnostic)
return diagnostic.code ~= "prettier/prettier"
end
}
),
null_ls.builtins.diagnostics.stylelint.with(
{
filetypes = { "scss", "less", "css", "sass", "vue" }
}
)
},
-- https://github.com/jose-elias-alvarez/null-ls.nvim/wiki/Formatting-on-save
on_attach = function(client, bufnr)
if client.supports_method("textDocument/formatting") then
vim.api.nvim_clear_autocmds({group = augroup, buffer = bufnr})
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
vim.api.nvim_create_autocmd(
"BufWritePre",
{
group = augroup,
buffer = bufnr,
callback = function()
vim.lsp.buf.format({bufnr = bufnr})
vim.lsp.buf.format({ bufnr = bufnr })
end
}
)
end
vim.diagnostic.config(
{
virtual_text = false
}
)
end
}
10 changes: 9 additions & 1 deletion nvim/after/plugin/telescope.lua
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,17 @@ require("telescope._extensions.zoxide.config").setup(
-- show me only the path with '~' for the home directory
list_command = "zoxide query -ls | grep -v '\\.local' | awk '{ print $2 }' | sed 's:" .. vim.env.HOME .. "/::'",
mappings = {
default = {
action = function(selection)
vim.cmd("cd " .. vim.env.HOME .. "/" .. selection.path)
end,
after_action = function(selection)
print("Directory changed to " .. selection.path)
end
},
["<C-l>"] = {
action = function(selection)
vim.cmd("lcd " .. selection.path)
vim.cmd("lcd " .. vim.env.HOME .. "/" .. selection.path)
end
}
}
Expand Down
77 changes: 31 additions & 46 deletions nvim/lua/lsp-settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ local servers = {
"bashls",
"cssls",
"denols",
"eslint",
-- "eslint",
"gopls",
"graphql",
"html",
"jsonls",
"phpactor",
"prismals",
"sumneko_lua",
"stylelint_lsp",
"svelte",
"tailwindcss",
"terraformls",
Expand Down Expand Up @@ -83,46 +82,36 @@ local denols = {
}
}

local stylelint_lsp = {
filetypes = { "css", "less", "scss", "vue", "javascriptreact", "typescriptreact" },
settings = {
stylelintplus = {
autoFixOnFormat = true,
autoFixOnSave = true
}
}
}

-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#eslint
local eslint = {
{
codeAction = {
disableRuleComment = {
enable = true,
location = "separateLine"
},
showDocumentation = {
enable = true
}
},
codeActionOnSave = {
enable = false,
mode = "all"
},
format = true,
nodePath = "",
onIgnoredFiles = "off",
packageManager = "npm",
quiet = false,
rulesCustomizations = {},
run = "onType",
useESLintClass = false,
validate = "on",
workingDirectory = {
mode = "location"
}
}
}
-- local eslint = {
-- {
-- codeAction = {
-- disableRuleComment = {
-- enable = true,
-- location = "separateLine"
-- },
-- showDocumentation = {
-- enable = true
-- }
-- },
-- codeActionOnSave = {
-- enable = false,
-- mode = "all"
-- },
-- format = true,
-- nodePath = "",
-- onIgnoredFiles = "off",
-- packageManager = "npm",
-- quiet = false,
-- rulesCustomizations = {},
-- run = "onType",
-- useESLintClass = false,
-- validate = "on",
-- workingDirectory = {
-- mode = "location"
-- }
-- }
-- }

local sumneko_lua = {
cmd = {
Expand Down Expand Up @@ -159,8 +148,7 @@ local jsonls = {

local custom_configs = {
denols = denols,
stylelint_lsp = stylelint_lsp,
eslint = eslint,
-- eslint = eslint,
sumneko_lua = sumneko_lua,
vuels = vuels,
jsonls = jsonls
Expand Down Expand Up @@ -201,9 +189,6 @@ local function file_exists(name)
end

local function setup_server(server)
if server == "stylelint_lsp" and not file_exists(os.getenv("PWD") .. "/package.json") then
return
end
if server == "denols" and file_exists(os.getenv("PWD") .. "/package.json") then
return
end
Expand Down
10 changes: 7 additions & 3 deletions zshenv
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@ export PATH="$HOME/.local/bin:$PATH"
NPM_GLOBAL="$HOME/.npm-global"
export PATH="$NPM_GLOBAL/bin:$PATH"

# volta manager
export VOLTA_HOME="$HOME/.volta"
export PATH="$VOLTA_HOME/bin:$PATH"
# pnpm
export PNPM_HOME="$HOME/.local/share/pnpm"
export PATH="$PNPM_HOME:$PATH"

# FNM
export PATH=/home/lukas/.fnm:$PATH
eval "$(fnm env --use-on-cd)"

# deno path
export DENO_INSTALL="/home/lukas/.deno"
Expand Down
3 changes: 3 additions & 0 deletions zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ autoload -Uz compinit

bindkey -e

# fix delete key
bindkey "^[[3~" delete-char

# Do not catch Ctrl+q and Ctrl+s by the terminal
# (I use it in vim)
stty start undef
Expand Down

0 comments on commit 8bd3162

Please sign in to comment.