mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-15 22:52:37 +00:00
Compare commits
2 Commits
2e3c750979
...
917ac3ff2a
| Author | SHA1 | Date | |
|---|---|---|---|
|
917ac3ff2a
|
|||
|
23bd867430
|
@@ -2,6 +2,7 @@ return {
|
||||
"hrsh7th/nvim-cmp",
|
||||
event = "InsertEnter",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer", -- source for text in buffer
|
||||
"hrsh7th/cmp-path", -- source for file system paths
|
||||
"L3MON4D3/LuaSnip", -- snippet engine
|
||||
@@ -33,7 +34,17 @@ return {
|
||||
["<C-j>"] = cmp.mapping.select_next_item(), -- next suggestion
|
||||
["<C-Space>"] = cmp.mapping.complete(), -- show completion suggestions
|
||||
["<C-e>"] = cmp.mapping.abort(), -- close completion window
|
||||
["<CR>"] = cmp.mapping.confirm({ select = false, behavior = cmp.ConfirmBehavior.Replace }),
|
||||
["<CR>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
if luasnip.expandable() then
|
||||
luasnip.expand()
|
||||
else
|
||||
cmp.confirm({ select = true })
|
||||
end
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end),
|
||||
-- TODO:
|
||||
-- The next two mappings are also implemented in the LuaSnip configuration,
|
||||
-- as <C-j> and <C-k> do they actually need to be here??
|
||||
@@ -69,119 +80,3 @@ return {
|
||||
})
|
||||
end,
|
||||
}
|
||||
-- return {
|
||||
-- "hrsh7th/nvim-cmp",
|
||||
-- enabled = true,
|
||||
-- dependencies = {
|
||||
-- "hrsh7th/cmp-nvim-lsp",
|
||||
-- "hrsh7th/cmp-buffer",
|
||||
-- "hrsh7th/cmp-path",
|
||||
-- "hrsh7th/cmp-cmdline",
|
||||
-- "hrsh7th/cmp-vsnip",
|
||||
-- "hrsh7th/vim-vsnip",
|
||||
-- "saadparwaiz1/cmp_luasnip",
|
||||
-- "f3fora/cmp-spell",
|
||||
-- "hrsh7th/cmp-calc",
|
||||
-- "hrsh7th/cmp-emoji",
|
||||
-- "L3MON4D3/LuaSnip",
|
||||
-- -- Adds a number of user-friendly snippets
|
||||
-- "rafamadriz/friendly-snippets",
|
||||
-- "onsails/lspkind.nvim", -- vs-code like pictograms
|
||||
-- },
|
||||
-- event = { "BufReadPre", "BufNewFile" },
|
||||
-- config = function()
|
||||
-- -- Setup nvim-cmp.
|
||||
-- local cmp = require("cmp")
|
||||
-- local lspkind = require("lspkind")
|
||||
-- local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
-- capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities)
|
||||
-- local luasnip = require("luasnip")
|
||||
-- require("luasnip.loaders.from_vscode").lazy_load()
|
||||
--
|
||||
-- require("lspconfig").sourcekit.setup({
|
||||
-- capabilities = capabilities,
|
||||
-- })
|
||||
--
|
||||
-- lspkind.init({
|
||||
-- symbol_map = {
|
||||
--
|
||||
-- Text = "",
|
||||
-- Method = "",
|
||||
-- Function = "",
|
||||
-- Constructor = "",
|
||||
-- Field = "ﰠ",
|
||||
-- Variable = "",
|
||||
-- Class = "ﴯ",
|
||||
-- Interface = "",
|
||||
-- Module = "",
|
||||
-- Property = "ﰠ",
|
||||
-- Unit = "塞",
|
||||
-- Value = "",
|
||||
-- Enum = "",
|
||||
-- Keyword = "",
|
||||
-- Snippet = "",
|
||||
-- Color = "",
|
||||
-- File = "",
|
||||
-- Reference = "",
|
||||
-- Folder = "",
|
||||
-- EnumMember = "",
|
||||
-- Constant = "",
|
||||
-- Struct = "פּ",
|
||||
-- Event = "",
|
||||
-- Operator = "",
|
||||
-- TypeParameter = "",
|
||||
-- },
|
||||
-- })
|
||||
--
|
||||
-- cmp.setup({
|
||||
-- completion = {
|
||||
-- completeopt = "menu,menuone,preview",
|
||||
-- },
|
||||
-- snippet = { -- configure how nvim-cmp interacts with snippet engine
|
||||
-- expand = function(args)
|
||||
-- luasnip.lsp_expand(args.body)
|
||||
-- end,
|
||||
-- },
|
||||
-- mapping = cmp.mapping.preset.insert({
|
||||
-- ["<C-k>"] = cmp.mapping.select_prev_item(), -- previous suggestion
|
||||
-- ["<C-j>"] = cmp.mapping.select_next_item(), -- next suggestion
|
||||
-- ["<C-Space>"] = cmp.mapping.complete(), -- show completion suggestions
|
||||
-- ["<C-e>"] = cmp.mapping.abort(), -- close completion window
|
||||
-- ["<CR>"] = cmp.mapping.confirm({ select = false, behavior = cmp.ConfirmBehavior.Replace }),
|
||||
-- ["<C-b>"] = cmp.mapping(function(fallback)
|
||||
-- if luasnip.jumpable(-1) then
|
||||
-- luasnip.jump(-1)
|
||||
-- else
|
||||
-- fallback()
|
||||
-- end
|
||||
-- end, { "i", "s" }),
|
||||
-- ["<C-f>"] = cmp.mapping(function(fallback)
|
||||
-- if luasnip.jumpable(1) then
|
||||
-- luasnip.jump(1)
|
||||
-- else
|
||||
-- fallback()
|
||||
-- end
|
||||
-- end, { "i", "s" }),
|
||||
-- }),
|
||||
-- -- sources for autocompletion
|
||||
-- sources = cmp.config.sources({
|
||||
-- { name = "nvim_lsp" },
|
||||
-- { name = "luasnip" }, -- snippets
|
||||
-- { name = "buffer" }, -- text within current buffer
|
||||
-- { name = "path" }, -- file system paths
|
||||
-- --{ name = "calc" },
|
||||
-- --{ name = "emoji" },
|
||||
-- --{ name = "spell" },
|
||||
-- }),
|
||||
-- -- configure lspkind for vs-code like pictograms in completion menu
|
||||
-- formatting = {
|
||||
-- expandable_indicator = true,
|
||||
-- fields = { "abbr", "kind", "menu" },
|
||||
-- format = lspkind.cmp_format({
|
||||
-- maxwidth = 50,
|
||||
-- ellipsis_char = "...",
|
||||
-- }),
|
||||
-- },
|
||||
-- })
|
||||
-- end,
|
||||
-- }
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
return {
|
||||
"L3MON4D3/LuaSnip",
|
||||
opts = {
|
||||
history = true,
|
||||
enable_autosnippets = false, -- don't automatically expand snippets.
|
||||
updatevents = "TextChanged,TextChangedI",
|
||||
},
|
||||
config = function()
|
||||
local ls = require("luasnip")
|
||||
local types = require("luasnip.util.types")
|
||||
ls.setup({
|
||||
history = true,
|
||||
enable_autosnippets = false,
|
||||
updatevents = "TextChanged,TextChangedI",
|
||||
extra_opts = {
|
||||
[types.choiceNode] = {
|
||||
active = {
|
||||
|
||||
@@ -2,6 +2,7 @@ local progress_handle
|
||||
|
||||
return {
|
||||
"wojciech-kulik/xcodebuild.nvim",
|
||||
--branch = "fix/issue-249",
|
||||
dependencies = {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
"MunifTanjim/nui.nvim",
|
||||
|
||||
@@ -12,7 +12,7 @@ local rep = require("luasnip.extras").rep
|
||||
-- Add snippets
|
||||
ls.add_snippets("swift", {
|
||||
-- Add a dependency snippet.
|
||||
s("@d", fmt("@Dependency(\\.{}) var {}", { i(1), rep(1) })),
|
||||
s({ trig = "@d", desc = "Add a dependency." }, fmt("@Dependency(\\.{}) var {}", { i(1), rep(1) })),
|
||||
|
||||
-- Add a dependency client.
|
||||
s(
|
||||
@@ -66,19 +66,23 @@ ls.add_snippets("swift", {
|
||||
)
|
||||
),
|
||||
|
||||
s({ trig = "spi", desc = "Add spi modifier." }, fmt("@_spi({})", { i(1, "name") })),
|
||||
-- Decorate a type or function with an @_spi(...)
|
||||
s({ trig = "@_s", desc = "Add spi modifier." }, fmt("@_spi({})", { i(1, "name") })),
|
||||
|
||||
-- Add an @_spi(...) import ...
|
||||
s(
|
||||
{ trig = "sii", desc = "Import with spi." },
|
||||
{ trig = "@_si", desc = "Import with spi." },
|
||||
fmt(
|
||||
[[
|
||||
@_spi({}) import {}
|
||||
{}
|
||||
]],
|
||||
{ i(1, "name"), i(2, "modlue"), i(0) }
|
||||
{ i(1, "name"), i(2, "module"), i(0) }
|
||||
)
|
||||
),
|
||||
|
||||
-- Document a function
|
||||
-- TODO: add dynamic number of prameters.
|
||||
s(
|
||||
{ trig = "docf", desc = "Document a function." },
|
||||
fmt(
|
||||
@@ -88,10 +92,11 @@ ls.add_snippets("swift", {
|
||||
/// - Parameters:
|
||||
/// - {}: {}
|
||||
]],
|
||||
{ i(1, "A short description."), i(2, "<param>"), i(3, "<param-description>") }
|
||||
{ i(1, "A short description."), i(2, "<param>"), i(3, "Describe the parameter.") }
|
||||
)
|
||||
),
|
||||
|
||||
-- Add a parameter to a documentation string.
|
||||
s(
|
||||
{ trig = "param", desc = "Add a parameter to documentation" },
|
||||
fmt(
|
||||
@@ -101,6 +106,8 @@ ls.add_snippets("swift", {
|
||||
{ i(1, "<param>"), i(2, "<description>") }
|
||||
)
|
||||
),
|
||||
|
||||
-- Add a withDependencies
|
||||
s(
|
||||
{ trig = "wd", desc = "withDependencies" },
|
||||
fmt(
|
||||
|
||||
100
tmux/tmux.conf
100
tmux/tmux.conf
@@ -88,24 +88,92 @@ set -g @plugin 'tmux-plugins/tmux-yank'
|
||||
#set -g @plugin 'erikw/tmux-powerline'
|
||||
set -g @plugin 'christoomey/vim-tmux-navigator'
|
||||
set -g @plugin 'catppuccin/tmux'
|
||||
set -g @plugin 'tmux-plugins/tmux-online-status'
|
||||
set -g @plugin 'tmux-plugins/tmux-battery'
|
||||
|
||||
set -g @catppuccin_flavor 'mocha' # latte, frappe, macchiato, mocha
|
||||
set -g @catppuccin_window_left_separator ""
|
||||
set -g @catppuccin_window_right_separator " "
|
||||
set -g @catppuccin_window_middle_separator " █"
|
||||
set -g @catppuccin_window_number_position "right"
|
||||
set -g @catppuccin_window_default_fill "number"
|
||||
set -g @catppuccin_window_default_text "#W"
|
||||
set -g @catppuccin_window_current_fill "number"
|
||||
set -g @catppuccin_window_current_text "#W"
|
||||
set -g @catppuccin_status_modules_right "directory session"
|
||||
set -g @catppuccin_status_left_separator " "
|
||||
set -g @catppuccin_status_right_separator ""
|
||||
set -g @catppuccin_status_right_separator_inverse "no"
|
||||
set -g @catppuccin_status_fill "icon"
|
||||
set -g @catppuccin_status_connect_separator "no"
|
||||
# set -g @catppuccin_flavor 'mocha' # latte, frappe, macchiato, mocha
|
||||
# set -g @catppuccin_window_left_separator ""
|
||||
# set -g @catppuccin_window_right_separator " "
|
||||
# set -g @catppuccin_window_middle_separator " █"
|
||||
# set -g @catppuccin_window_number_position "right"
|
||||
# set -g @catppuccin_window_default_fill "number"
|
||||
# set -g @catppuccin_window_current_fill "number"
|
||||
# set -g @catppuccin_status_modules_right "directory session"
|
||||
# set -g @catppuccin_status_left_separator " "
|
||||
# set -g @catppuccin_status_right_separator ""
|
||||
# set -g @catppuccin_status_right_separator_inverse "no"
|
||||
# set -g @catppuccin_status_fill "icon"
|
||||
# set -g @catppuccin_status_connect_separator "no"
|
||||
# set -g @catppuccin_window_default_text " #{window_nam}"
|
||||
# set -g @catppuccin_window_current_text "#{window_name}"
|
||||
# set -g @catppuccin_window_status "icon"
|
||||
# set -g @catppuccin_window_default_fill "number"
|
||||
# set -g @catppuccin_window_number_position "left"
|
||||
#
|
||||
# set -g @catppuccin_directory_text "#{pane_current_path}"
|
||||
# Configure Catppuccin
|
||||
set -g @catppuccin_flavor "macchiato"
|
||||
set -g @catppuccin_status_background "none"
|
||||
set -g @catppuccin_window_status_style "none"
|
||||
set -g @catppuccin_pane_status_enabled "off"
|
||||
set -g @catppuccin_pane_border_status "off"
|
||||
|
||||
set -g @catppuccin_directory_text "#{pane_current_path}"
|
||||
# Configure Online
|
||||
set -g @online_icon "ok"
|
||||
set -g @offline_icon "nok"
|
||||
|
||||
# status left look and feel
|
||||
set -g status-left-length 100
|
||||
set -g status-left ""
|
||||
set -ga status-left "#{?client_prefix,#{#[bg=#{@thm_red},fg=#{@thm_bg},bold] #S },#{#[bg=#{@thm_bg},fg=#{@thm_green}] #S }}"
|
||||
set -ga status-left "#[bg=#{@thm_bg},fg=#{@thm_overlay_0},none]│"
|
||||
set -ga status-left "#[bg=#{@thm_bg},fg=#{@thm_maroon}] #{pane_current_command} "
|
||||
set -ga status-left "#[bg=#{@thm_bg},fg=#{@thm_overlay_0},none]│"
|
||||
set -ga status-left "#[bg=#{@thm_bg},fg=#{@thm_blue}] #{=/-32/...:#{s|$USER|~|:#{b:pane_current_path}}} "
|
||||
set -ga status-left "#[bg=#{@thm_bg},fg=#{@thm_overlay_0},none]#{?window_zoomed_flag,│,}"
|
||||
set -ga status-left "#[bg=#{@thm_bg},fg=#{@thm_yellow}]#{?window_zoomed_flag, zoom ,}"
|
||||
|
||||
# status right look and feel
|
||||
set -g status-right-length 100
|
||||
set -g status-right ""
|
||||
set -ga status-right "#{?#{e|>=:10,#{battery_percentage}},#{#[bg=#{@thm_red},fg=#{@thm_bg}]},#{#[bg=#{@thm_bg},fg=#{@thm_pink}]}} #{battery_icon} #{battery_percentage} "
|
||||
set -ga status-right "#[bg=#{@thm_bg},fg=#{@thm_overlay_0}, none]│"
|
||||
set -ga status-right "#[bg=#{@thm_bg}]#{?#{==:#{online_status},ok},#[fg=#{@thm_mauve}] on ,#[fg=#{@thm_red},bold]#[reverse] off }"
|
||||
set -ga status-right "#[bg=#{@thm_bg},fg=#{@thm_overlay_0}, none]│"
|
||||
set -ga status-right "#[bg=#{@thm_bg},fg=#{@thm_blue}] %Y-%m-%d %H:%M "
|
||||
|
||||
# bootstrap tpm
|
||||
if "test ! -d ~/.tmux/plugins/tpm" \
|
||||
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
|
||||
|
||||
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
|
||||
run '~/.tmux/plugins/tpm/tpm'
|
||||
|
||||
# Configure Tmux
|
||||
set -g status-position top
|
||||
set -g status-style "bg=#{@thm_bg}"
|
||||
set -g status-justify "absolute-centre"
|
||||
|
||||
# pane border look and feel
|
||||
setw -g pane-border-status top
|
||||
setw -g pane-border-format ""
|
||||
setw -g pane-active-border-style "bg=#{@thm_bg},fg=#{@thm_overlay_0}"
|
||||
setw -g pane-border-style "bg=#{@thm_bg},fg=#{@thm_surface_0}"
|
||||
setw -g pane-border-lines single
|
||||
|
||||
# window look and feel
|
||||
set -wg automatic-rename on
|
||||
set -g automatic-rename-format "Window"
|
||||
|
||||
set -g window-status-format " #I#{?#{!=:#{window_name},Window},: #W,} "
|
||||
set -g window-status-style "bg=#{@thm_bg},fg=#{@thm_rosewater}"
|
||||
set -g window-status-last-style "bg=#{@thm_bg},fg=#{@thm_peach}"
|
||||
set -g window-status-activity-style "bg=#{@thm_red},fg=#{@thm_bg}"
|
||||
set -g window-status-bell-style "bg=#{@thm_red},fg=#{@thm_bg},bold"
|
||||
set -gF window-status-separator "#[bg=#{@thm_bg},fg=#{@thm_overlay_0}]│"
|
||||
|
||||
set -g window-status-current-format " #I#{?#{!=:#{window_name},Window},: #W,} "
|
||||
set -g window-status-current-style "bg=#{@thm_peach},fg=#{@thm_bg},bold"
|
||||
|
||||
# Needs to stay at the bottom.
|
||||
run '~/.config/tmux/plugins/tpm/tpm'
|
||||
|
||||
Reference in New Issue
Block a user