Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlo Gravador committed Dec 17, 2023
1 parent 2c91e62 commit cc2a13c
Show file tree
Hide file tree
Showing 11 changed files with 170 additions and 147 deletions.
20 changes: 20 additions & 0 deletions .gitconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[core]
editor = vim
[difftool]
prompt = true
[diff]
tool = nvimdiff
[difftool "nvimdiff"]
cmd = "vim -d \"$LOCAL\" \"$REMOTE\""
[user]
name = Carlo Gravador
email = [email protected]
[pager]
branch = false
[merge]
tool = vimdiff
[mergetool]
keepBackup = false

[mergetool "vimdiff"]
cmd = vim -d $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J'
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "bat/themes/bat_dracula_patched"]
path = bat/themes/bat_dracula_patched
url = [email protected]:carlogravador/sublime.git
1 change: 1 addition & 0 deletions bat/themes/bat_dracula_patched
Submodule bat_dracula_patched added at f8129a
32 changes: 32 additions & 0 deletions nvim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,35 @@ require('nvim_tree_config')
require('comment_nvim_config')

require('terminal_config')

require 'colorizer'.setup {
filetypes = { "css", "scss" },
user_default_options = {
RGB = true, -- #RGB hex codes
RRGGBB = true, -- #RRGGBB hex codes
-- names = true, -- "Name" codes like Blue or blue
RRGGBBAA = false, -- #RRGGBBAA hex codes
AARRGGBB = false, -- 0xAARRGGBB hex codes
-- rgb_fn = false, -- CSS rgb() and rgba() functions
rgb_fn = true, -- CSS rgb() and rgba() functions
hsl_fn = false, -- CSS hsl() and hsla() functions
css = false, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
css_fn = false, -- Enable all CSS *functions*: rgb_fn, hsl_fn
-- Available modes for `mode`: foreground, background, virtualtext
mode = "background", -- Set the display mode.
-- Available methods are false / true / "normal" / "lsp" / "both"
-- True is same as normal
tailwind = false, -- Enable tailwind colors
-- parsers can contain values used in |user_default_options|
sass = { enable = false, parsers = { "css" }, }, -- Enable sass colors
virtualtext = "",
-- update color values even if buffer is not focused
-- example use: cmp_menu, cmp_docs
always_update = false
},
-- all the sub-options of filetypes apply to buftypes
buftypes = {},

}
-- require('nvim-highlight-colors').setup {}
vim.g.python3_host_prog = '/usr/bin/python3'
6 changes: 6 additions & 0 deletions nvim/lua/lsp_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ for _, lsp in ipairs(servers) do
})
end

require('lspconfig')['clangd'].setup({
on_attach = on_attach,
flags = lsp_flags,
})


-- Addtional mappings for LSP
local t = function(str)
return vim.api.nvim_replace_termcodes(str, true, true, true)
Expand Down
13 changes: 13 additions & 0 deletions nvim/lua/packer_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,19 @@ return require('packer').startup(
requires = {
'nvim-tree/nvim-web-devicons', -- optional, for file icons
},

}

-- use 'brenoprata10/nvim-highlight-colors'
-- use 'ap/vim-css-color'
use 'NvChad/nvim-colorizer.lua'

use 'tpope/vim-surround'

use({
"iamcco/markdown-preview.nvim",
run = function() vim.fn["mkdp#util#install"]() end,
})

end
)
16 changes: 8 additions & 8 deletions nvim/lua/treesitter_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ require'nvim-treesitter.configs'.setup({
"dockerfile",
"git_rebase",
"gitcommit",
"help",
"vimdoc",
"html",
"htmldjango",
"ini",
Expand Down Expand Up @@ -59,13 +59,13 @@ require'nvim-treesitter.configs'.setup({
-- list of language that will be disabled
-- disable = { "c", "rust" },
-- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files
disable = function(lang, buf)
local max_filesize = 100 * 1024 -- 100 KB
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
if ok and stats and stats.size > max_filesize then
return true
end
end,
-- disable = function(lang, buf)
-- local max_filesize = 100 * 1024 -- 100 KB
-- local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
-- if ok and stats and stats.size > max_filesize then
-- return true
-- end
-- end,

-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
Expand Down
139 changes: 0 additions & 139 deletions nvim/plugin/packer_compiled.lua

This file was deleted.

44 changes: 44 additions & 0 deletions skhd/skhdrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Changing Window focus within space
alt - j : yabai -m window --focus south
alt - k : yabai -m window --focus north
alt - h : yabai -m window --focus west
alt - l : yabai -m window --focus east

# Change focus between external displays
alt - u : yabai -m display --focus north
alt - d : yabai -m display --focus south

# Modifying the layout
# rotate clockwise
shift + alt - r : yabai -m space --rotate 270
# flip along y axis
shift + alt - y : yabai -m space --mirror y-axis
# flip along x axis
shift + alt - x : yabai -m space --mirror x-axis
# toggle window float
shift + alt - t : yabai -m window --toggle float --grid 4:4:1:1:2:2
# Toggle split orientation
shift + alt - space : yabai -m window --toggle split

# Modifying window size
# Maximize window
# shift + alt - m : yabai -m window --toggle zoom-fullscreen
shift + alt - m : ~/.config/skhd/yabai_maxmize_window.sh
shift + alt - e : yabai -m space --balance

# Moving windows around
shift + alt - j : yabai -m window --swap south
shift + alt - k : yabai -m window --swap north
shift + alt - h : yabai -m window --swap west
shift + alt - l : yabai -m window --swap east

# Moving windows and split
shift + alt - j : yabai -m window --swap south
shift + alt - k : yabai -m window --swap north
shift + alt - h : yabai -m window --swap west
shift + alt - l : yabai -m window --swap east

ctrl + alt - j : yabai -m window --warp south
ctrl + alt - k : yabai -m window --warp north
ctrl + alt - h : yabai -m window --warp west
ctrl + alt - l : yabai -m window --warp east
16 changes: 16 additions & 0 deletions skhd/yabai_maxmize_window.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env sh

# Get the window information in JSON format
window_info=$(yabai -m query --windows --window)

# Check if the currently focused window is floating
is_floating=$(echo "$window_info" | jq '.["is-floating"]')
echo "${is_floating}"

if [ "${is_floating}" = "true" ]; then
# If the window is not maximized, maximize it
yabai -m window --grid 1:1:0:0:1:1

else
yabai -m window --toggle zoom-fullscreen
fi
27 changes: 27 additions & 0 deletions yabai/yabairc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# bsp, stack, float
yabai -m config layout bsp

yabai -m config window_placement second_child

# padding
yabai -m config top_padding 12
yabai -m config bottom_padding 12
yabai -m config left_padding 12
yabai -m config right_padding 12
yabai -m config window_gap 12

# mouse settings
yabai -m config mouse_follows_focus on

yabai -m config mouse_modifier alt
# left click + drag
yabai -m config mouse_action1 move
# right click + drag
yabai -m config mouse_action2 resize

yabai -m mouse_drop_action swap

# Disable specific apps
yabai -m rule --add app="^System Settings$" manage=off
yabai -m rule --add app="^Calculator$" manage=off
yabai -m rule --add app="^Karabiner-Elements$" manage=off

0 comments on commit cc2a13c

Please sign in to comment.