Browse Source

feat: add organise imports function to typescript lsp

master^2
Tovi Jaeschke-Rogers 3 days ago
parent
commit
638ba8cd03
5 changed files with 19 additions and 5 deletions
  1. +1
    -2
      .config/aliasrc
  2. +1
    -1
      .config/nvim/lua/core/autocmd.lua
  3. +15
    -0
      .config/nvim/lua/plugins/lspconfig.lua
  4. +1
    -1
      .local/bin/brightness-down
  5. +1
    -1
      .local/bin/brightness-up

+ 1
- 2
.config/aliasrc View File

@ -7,7 +7,7 @@ alias ll="ls -G -alh"
alias vim='nvim'
alias grep='grep --color=auto'
alias vz="nvim ${ZDOTDIR}/.zshrc && source ${ZDOTDIR}/.zshrc"
alias va="nvim ~/.config/aliasrc && source ${ZDOTDIR}.zshrc"
alias va="nvim ~/.config/aliasrc && source ${ZDOTDIR}/.zshrc"
alias sz='source ~/.zshrc'
alias c="xclip -selection clipboard"
alias v="xclip -selection clipboard -o"
@ -29,7 +29,6 @@ alias paratest="docker compose exec fpm ./test"
alias fresh="docker compose exec fpm php artisan migrate:fresh --seed"
alias ts="~/.local/bin/tmux-sessionizer"
alias tmux="tmux attach-session || tmux"
# Clipboard
alias c="xclip -selection clipboard"


+ 1
- 1
.config/nvim/lua/core/autocmd.lua View File

@ -28,7 +28,7 @@ local aucmd_dict = {
FileType = {
{
-- Set tabstop to 2 for Dart, Vue, JavaScript, TypeScript, and JSON files
pattern = "dart,vue,javascript,typescript,json,markdown",
pattern = "html,dart,vue,javascript,typescript,json,markdown,css,sass",
callback = function()
vim.opt_local.tabstop = 2
vim.opt_local.softtabstop = 2


+ 15
- 0
.config/nvim/lua/plugins/lspconfig.lua View File

@ -152,6 +152,15 @@ return {
return exepath('python3') or exepath('python') or 'python'
end
local function organize_imports()
local params = {
command = "_typescript.organizeImports",
arguments = {vim.api.nvim_buf_get_name(0)},
title = ""
}
vim.lsp.buf.execute_command(params)
end
local servers = {
ts_ls = {
init_options = {
@ -168,6 +177,12 @@ return {
"typescript",
"vue",
},
commands = {
OrganizeImports = {
organize_imports,
description = "Organize Imports"
}
}
},
volar = {


+ 1
- 1
.local/bin/brightness-down View File

@ -4,7 +4,7 @@ set -e
# Define the backlight device
BACKLIGHT_DEVICE="/sys/class/backlight/intel_backlight"
DECREMENT=300 # Adjust this to the value you want to increase
DECREMENT=5000 # Adjust this to the value you want to increase
# Get the current and max brightness
current_brightness=$(cat "$BACKLIGHT_DEVICE/brightness")


+ 1
- 1
.local/bin/brightness-up View File

@ -4,7 +4,7 @@ set -e
# Define the backlight device
BACKLIGHT_DEVICE="/sys/class/backlight/intel_backlight"
INCREMENT=300 # Adjust this to the value you want to increase
INCREMENT=5000 # Adjust this to the value you want to increase
# Get the current and max brightness
current_brightness=$(cat "$BACKLIGHT_DEVICE/brightness")


Loading…
Cancel
Save