feat: some stuff
This commit is contained in:
parent
dd42271f78
commit
47c9f5702b
@ -16,7 +16,7 @@ map("n", "gd", "<Cmd>lua vim.lsp.buf.definition()<CR>", options)
|
|||||||
map("n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", options)
|
map("n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", options)
|
||||||
map("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", options)
|
map("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", options)
|
||||||
map("n", "K", "<Cmd>lua vim.lsp.buf.hover()<CR>", options)
|
map("n", "K", "<Cmd>lua vim.lsp.buf.hover()<CR>", options)
|
||||||
map("n", "<Leader>e", "<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>", options)
|
map("n", "<Leader>e", "<cmd>lua vim.diagnostic.open_float()<CR>", options)
|
||||||
map("n", "<Leader>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", options)
|
map("n", "<Leader>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", options)
|
||||||
map("n", "<Leader>c", "<cmd>lua vim.lsp.buf.code_action()<CR>", options)
|
map("n", "<Leader>c", "<cmd>lua vim.lsp.buf.code_action()<CR>", options)
|
||||||
map("n", "<Leader><C-f>", ":Format<CR>", options)
|
map("n", "<Leader><C-f>", ":Format<CR>", options)
|
||||||
|
@ -1,9 +1,21 @@
|
|||||||
local lsp = require "lspconfig"
|
local lsp = require "lspconfig"
|
||||||
local lsp_status = require("lsp-status")
|
local lsp_status = require("lsp-status")
|
||||||
|
|
||||||
|
_G.lsp_organize_imports = function()
|
||||||
|
local params = {
|
||||||
|
command = "_typescript.organizeImports",
|
||||||
|
arguments = {vim.api.nvim_buf_get_name(0)},
|
||||||
|
title = ""
|
||||||
|
}
|
||||||
|
vim.lsp.buf.execute_command(params)
|
||||||
|
end
|
||||||
|
|
||||||
-- function to attach completion when setting up lsp
|
-- function to attach completion when setting up lsp
|
||||||
local function on_attach()
|
local function on_attach()
|
||||||
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
|
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
|
||||||
|
|
||||||
|
vim.cmd("command! LspOrganize lua lsp_organize_imports()")
|
||||||
|
vim.api.nvim_buf_map(bufnr, "n", "gs", ":LspOrganize<CR>", {silent = true})
|
||||||
end
|
end
|
||||||
|
|
||||||
local system_name = ""
|
local system_name = ""
|
||||||
@ -76,25 +88,9 @@ lsp.svelte.setup {
|
|||||||
}
|
}
|
||||||
|
|
||||||
-- Typescript Language Server
|
-- Typescript Language Server
|
||||||
local function organize_imports()
|
|
||||||
local params = {
|
|
||||||
command = "_typescript.organizeImports",
|
|
||||||
arguments = {vim.api.nvim_buf_get_name(bufnr)},
|
|
||||||
title = ""
|
|
||||||
}
|
|
||||||
|
|
||||||
vim.lsp.buf_request_sync(bufnr, "workspace/executeCommand", params, 500)
|
|
||||||
end
|
|
||||||
|
|
||||||
lsp.tsserver.setup {
|
lsp.tsserver.setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
capabilities = lsp_status.capabilities,
|
capabilities = lsp_status.capabilities,
|
||||||
commands = {
|
|
||||||
OrganizeImports = {
|
|
||||||
organize_imports,
|
|
||||||
description = "Organize Imports"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-- JSON ls setup
|
-- JSON ls setup
|
||||||
|
@ -36,6 +36,7 @@ set $toggle_layout ~/.config/sway/toggle_layout.sh
|
|||||||
set $toggle_gaps ~/.config/sway/toggle_gaps.sh
|
set $toggle_gaps ~/.config/sway/toggle_gaps.sh
|
||||||
set $web_search $wofi_scripts/web-search.sh
|
set $web_search $wofi_scripts/web-search.sh
|
||||||
set $select_window ~/.config/sway/select_window.sh
|
set $select_window ~/.config/sway/select_window.sh
|
||||||
|
set $select_emoji $wofi_scripts/wofi-emoji
|
||||||
|
|
||||||
# Input configuration
|
# Input configuration
|
||||||
input * {
|
input * {
|
||||||
@ -216,7 +217,7 @@ output * bg `find ~/.customization/background -type f | shuf -n 1` fill
|
|||||||
# -- Entire Screen
|
# -- Entire Screen
|
||||||
bindsym $mod+s exec $screenshot
|
bindsym $mod+s exec $screenshot
|
||||||
|
|
||||||
|
bindsym $mod+i exec $select_emoji
|
||||||
bindsym $mod+Tab exec $select_window
|
bindsym $mod+Tab exec $select_window
|
||||||
#
|
#
|
||||||
# Scratchpad:
|
# Scratchpad:
|
||||||
|
1810
configs/wofi/wofi-emoji
Executable file
1810
configs/wofi/wofi-emoji
Executable file
File diff suppressed because it is too large
Load Diff
@ -13,6 +13,8 @@ alias zshi="cd ~/.dotfiles && vim configs/init.lua && cd -"
|
|||||||
alias zshc="cd ~/.dotfiles && vim configs/.zshrc && cd -"
|
alias zshc="cd ~/.dotfiles && vim configs/.zshrc && cd -"
|
||||||
alias zshu="source ~/.zshrc"
|
alias zshu="source ~/.zshrc"
|
||||||
|
|
||||||
|
alias online="ping 1.1.1.1"
|
||||||
|
|
||||||
alias vim="nvim"
|
alias vim="nvim"
|
||||||
alias v="nvim"
|
alias v="nvim"
|
||||||
|
|
||||||
|
@ -6,3 +6,4 @@ source $(dirname "$0")/functions/fp.zsh;
|
|||||||
source $(dirname "$0")/functions/rn.zsh;
|
source $(dirname "$0")/functions/rn.zsh;
|
||||||
source $(dirname "$0")/functions/sum.zsh;
|
source $(dirname "$0")/functions/sum.zsh;
|
||||||
source $(dirname "$0")/functions/mke.zsh;
|
source $(dirname "$0")/functions/mke.zsh;
|
||||||
|
source $(dirname "$0")/functions/myip.zsh;
|
||||||
|
8
configs/zsh/functions/myip.zsh
Normal file
8
configs/zsh/functions/myip.zsh
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
function myip(){
|
||||||
|
RES="$(curl -s ifconfig.co/json)"
|
||||||
|
echo $RES | jq -r ' .ip '
|
||||||
|
if [ "$1" = "-a" ]; then
|
||||||
|
echo "$(echo $RES | jq -r '.country') | $(echo $RES | jq -r '.city')"
|
||||||
|
echo "$(echo $RES | jq -r '.time_zone')"
|
||||||
|
fi
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user