Updates to:

- neovim
- tmux
- alacritty
This commit is contained in:
Sagi Dayan 2023-02-21 15:00:51 +02:00
parent 338dd906f3
commit 3bfed39c11
Signed by: sagi
GPG key ID: FAB96BFC63B46458
16 changed files with 213 additions and 56 deletions

View file

@ -14,8 +14,9 @@ Ansible Lint:
- ansible-lint --version - ansible-lint --version
script: script:
- ansible-lint --force-color . &> lint-output.txt - ansible-lint --force-color . &> lint-output.txt
- echo $? > status
- cat lint-output.txt - cat lint-output.txt
- if [ ! -z "$(cat lint-output.txt)" ]; then echo "Lint returned with warnings/fails"; exit 1; fi - if [ $(cat status) -ne 0 ]; then echo "Lint returned with warnings/fails"; exit 1; fi
Run Workstation playbook on fedora: Run Workstation playbook on fedora:
stage: x86 Systems stage: x86 Systems

View file

@ -2,4 +2,5 @@
output_dir = /tmp/artifacts output_dir = /tmp/artifacts
transport = local transport = local
callbacks_enabled = junit, timer, profile_roles
callback_whitelist = junit, timer, profile_roles callback_whitelist = junit, timer, profile_roles

View file

@ -1,5 +1,6 @@
--- ---
window: window:
opacity: 0.9
# Blank space added around the window in pixels # Blank space added around the window in pixels
padding: padding:
x: 2 x: 2
@ -47,6 +48,110 @@ cursor:
# Themes # # Themes #
########################################################### ###########################################################
schemes: schemes:
nordfox: &nordfox
primary:
background: '0x2e3440'
foreground: '0xcdcecf'
# Normal colors
normal:
black: '0x3b4252'
red: '0xbf616a'
green: '0xa3be8c'
yellow: '0xebcb8b'
blue: '0x81a1c1'
magenta: '0xb48ead'
cyan: '0x88c0d0'
white: '0xe5e9f0'
# Bright colors
bright:
black: '0x465780'
red: '0xd06f79'
green: '0xb1d196'
yellow: '0xf0d399'
blue: '0x8cafd2'
magenta: '0xc895bf'
cyan: '0x93ccdc'
white: '0xe7ecf4'
indexed_colors:
- { index: 16, color: '0xc9826b' }
- { index: 17, color: '0xbf88bc' }
terafox: &terafox
primary:
background: '0x152528'
foreground: '0xe6eaea'
# Normal colors
normal:
black: '0x2f3239'
red: '0xe85c51'
green: '0x7aa4a1'
yellow: '0xfda47f'
blue: '0x5a93aa'
magenta: '0xad5c7c'
cyan: '0xa1cdd8'
white: '0xebebeb'
# Bright colors
bright:
black: '0x4e5157'
red: '0xeb746b'
green: '0x8eb2af'
yellow: '0xfdb292'
blue: '0x73a3b7'
magenta: '0xb97490'
cyan: '0xafd4de'
white: '0xeeeeee'
indexed_colors:
- { index: 16, color: '0xff8349' }
- { index: 17, color: '0xcb7985' }
nightfox: &nightfox
# Default colors
primary:
background: '0x192330'
foreground: '0xcdcecf'
# Normal colors
normal:
black: '0x393b44'
red: '0xc94f6d'
green: '0x81b29a'
yellow: '0xdbc074'
blue: '0x719cd6'
magenta: '0x9d79d6'
cyan: '0x63cdcf'
white: '0xdfdfe0'
# Bright colors
bright:
black: '0x575860'
red: '0xd16983'
green: '0x8ebaa4'
yellow: '0xe0c989'
blue: '0x86abdc'
magenta: '0xbaa1e2'
cyan: '0x7ad4d6'
white: '0xe4e4e5'
indexed_colors:
- { index: 16, color: '0xf4a261' }
- { index: 17, color: '0xd67ad2' }
melange: &melange
primary:
foreground: '#ECE1D7'
background: '#2A2520'
normal:
black: '#352F2A'
red: '#B65C60'
green: '#78997A'
yellow: '#EBC06D'
blue: '#9AACCE'
magenta: '#B380B0'
cyan: '#86A3A3'
white: '#A38D78'
bright:
black: '#4D453E'
red: '#F17C64'
green: '#99D59D'
yellow: '#EBC06D'
blue: '#9AACCE'
magenta: '#CE9BCB'
cyan: '#88B3B2'
white: '#C1A78E'
# For themes -> https://github.com/aarowill/base16-alacritty # For themes -> https://github.com/aarowill/base16-alacritty
# Base16 Monokai 256 - alacritty color config # Base16 Monokai 256 - alacritty color config
# Wimer Hazenberg (http://www.monokai.nl) # Wimer Hazenberg (http://www.monokai.nl)
@ -319,4 +424,4 @@ schemes:
white: '#aeb3bb' white: '#aeb3bb'
draw_bold_text_with_bright_colors: true draw_bold_text_with_bright_colors: true
colors: *gruvbox colors: *nightfox

View file

@ -1,2 +1 @@
require("user") require("user")

View file

@ -50,5 +50,6 @@ cmp.setup({
{ name = "path" }, { name = "path" },
{ name = "luasnip" }, { name = "luasnip" },
{ name = "buffer" }, { name = "buffer" },
{ name = 'nvim_lsp_signature_help' },
}, },
}) })

View file

@ -10,7 +10,22 @@ if gb_status_ok then
have_theme = true have_theme = true
end end
vim.opt.background = "dark" local nightfox_status_ok, nightfox = pcall(require, 'nightfox')
if have_theme then if nightfox_status_ok then
vim.cmd("colorscheme " .. vars.colorscheme) have_theme = true
nightfox.setup({
options = {
dim_inactive = false
}
})
end
vim.opt.background = "dark"
local colorscheme = vars.themes[vars.colorscheme].colorscheme
if have_theme then
vim.cmd("colorscheme " .. colorscheme)
end
if vars.transparent_bg then
vim.cmd("highlight Normal guibg=none")
end end

View file

@ -1,7 +1,9 @@
require("user.settings")
require("user.packer") require("user.packer")
require("user.init_plugins") vim.cmd(":PackerInstall")
require("user.settings")
require("user.init_plugins")
require("user.lsp") require("user.lsp")
require("user.cmp") require("user.cmp")
require("user.treesitter") require("user.treesitter")
@ -11,4 +13,3 @@ require("user.colors")
-- Make sure plugins are installed -- Make sure plugins are installed
--vim.cmd(":PackerClean") --vim.cmd(":PackerClean")
vim.cmd(":PackerInstall")

View file

@ -22,9 +22,3 @@ local autopairs_status_ok, autopairs = pcall(require, "nvim-autopairs")
if autopairs_status_ok then if autopairs_status_ok then
autopairs.setup {} autopairs.setup {}
end end
-- Illuminate
--local status_ok, illuminate = pcall(require, "illuminate")
--if status_ok then
-- illuminate.configure()
--end

View file

@ -1,3 +1,4 @@
local vars = require('user.vars')
local M = {} local M = {}
M.setup = function() M.setup = function()
@ -49,11 +50,12 @@ local function lsp_highlight_document(client, bufnr)
group = "lsp_document_highlight", group = "lsp_document_highlight",
desc = "Clear All the References", desc = "Clear All the References",
}) })
vim.cmd [[ local h_bg = vars.themes[vars.colorscheme].highlight_bg_color
highlight LspReferenceText guifg=NONE guibg=#928374 if h_bg then
highlight LspReferenceRead guifg=NONE guibg=#928374 vim.cmd('highlight LspReferenceText guifg=NONE guibg=' .. h_bg)
highlight LspReferenceWrite guifg=NONE guibg=#928374 vim.cmd('highlight LspReferenceWrite guifg=NONE guibg=' .. h_bg)
]] vim.cmd('highlight LspReferenceRead guifg=NONE guibg=' .. h_bg)
end
end end
end end
@ -65,15 +67,16 @@ local function lsp_keymaps(bufnr)
vim.api.nvim_buf_set_keymap(bufnr, "n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts) vim.api.nvim_buf_set_keymap(bufnr, "n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "<C-k>", "<cmd>lua vim.lsp.buf.signature_help()<CR>", opts) vim.api.nvim_buf_set_keymap(bufnr, "n", "<C-k>", "<cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", opts) vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "<leader>e", "<cmd>lua vim.diagnostic.open_float()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts) vim.api.nvim_buf_set_keymap(bufnr, "n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
vim.api.nvim_buf_set_keymap(bufnr, "n", "<M-f>", "<cmd>lua vim.lsp.buf.format { async = true }<CR>", opts) vim.api.nvim_buf_set_keymap(bufnr, "n", "<M-f>", "<cmd>lua vim.lsp.buf.format { async = true }<CR>", opts)
vim.cmd [[ command! Format execute 'lua vim.lsp.buf.formatting()' ]] vim.cmd [[ command! Format execute 'lua vim.lsp.buf.formatting_sync' ]]
end end
M.on_attach = function(client, bufnr) M.on_attach = function(client, bufnr)
if client.name == "tsserver" then --if client.name == "tsserver" then
client.server_capabilities.documentFormattingProvider = false -- client.server_capabilities.documentFormattingProvider = false
end --end
lsp_keymaps(bufnr) lsp_keymaps(bufnr)
lsp_highlight_document(client, bufnr) lsp_highlight_document(client, bufnr)
vim.cmd [[autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_sync()]] vim.cmd [[autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_sync()]]

View file

@ -5,8 +5,9 @@ if not status_ok then
return return
end end
lualine.setup({ lualine.setup {
options = { options = {
theme = vars.colorscheme, -- theme = vars.colorscheme, --https://github.com/nvim-lualine/lualine.nvim/blob/master/THEMES.md
theme = vars.themes[vars.colorscheme].lualine_theme
} }
}) }

View file

@ -10,6 +10,7 @@ return require("packer").startup(function(use)
'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-buffer', 'hrsh7th/cmp-buffer',
'hrsh7th/nvim-cmp', 'hrsh7th/nvim-cmp',
'hrsh7th/cmp-nvim-lsp-signature-help',
'onsails/lspkind.nvim', 'onsails/lspkind.nvim',
'nvim-lua/lsp_extensions.nvim', 'nvim-lua/lsp_extensions.nvim',
'glepnir/lspsaga.nvim', 'glepnir/lspsaga.nvim',
@ -33,8 +34,13 @@ return require("packer").startup(function(use)
requires = { 'kyazdani42/nvim-web-devicons', opt = true } requires = { 'kyazdani42/nvim-web-devicons', opt = true }
} }
-- -- Colorshemes -- --
-- Gruvbox -- Gruvbox
use 'ellisonleao/gruvbox.nvim' use 'ellisonleao/gruvbox.nvim'
-- Melange
use 'savq/melange'
-- Nightfox
use 'EdenEast/nightfox.nvim'
-- Git Gutter -- Git Gutter
use { use {

View file

@ -47,3 +47,5 @@ vim.wo.cursorline = true
-- Enable mouse support -- Enable mouse support
vim.opt.mouse = 'a' vim.opt.mouse = 'a'
vim.opt.termguicolors = true

View file

@ -1,5 +1,33 @@
local M = {} local M = {}
M.colorscheme = 'gruvbox' M.colorscheme = 'nightfox'
M.transparent_bg = true
M.themes = {
gruvbox = {
colorscheme = 'gruvbox',
lualine_theme = 'gruvbox',
},
melange = {
colorscheme = 'melange',
lualine_theme = 'OceanicNext',
},
nightfox = {
colorscheme = 'nightfox',
lualine_theme = 'nightfox'
}
}
-- Gruvbox
local st_ok, palette = pcall(require, M.colorscheme .. '.palette')
if st_ok then
M.themes.gruvbox.highlight_bg_color = palette.gray
end
-- melange
st_ok, palette = pcall(require, M.colorscheme .. '.palettes.dark')
if st_ok then
M.themes.melange.highlight_bg_color = palette.a.sel
end
return M return M

View file

@ -30,8 +30,8 @@ nord="Nord"
export BAT_THEME="$nord" export BAT_THEME="$nord"
export VISUAL=vim; export VISUAL=nvim;
export EDITOR=vim; export EDITOR=nvim;

View file

@ -26,7 +26,7 @@ setw -g mouse on
# Set easier window split keys # Set easier window split keys
bind-key | split-window -h -c "#{pane_current_path}" bind-key | split-window -h -c "#{pane_current_path}"
bind-key \\ split-window -h -c "#{pane_current_path}" bind-key \ split-window -h -c "#{pane_current_path}"
bind-key - split-window -v -c "#{pane_current_path}" bind-key - split-window -v -c "#{pane_current_path}"
# close window with <prefix-q> # close window with <prefix-q>
bind-key q kill-window bind-key q kill-window
@ -60,7 +60,7 @@ bind-key b run-shell "tmux neww -n ' Git Branches' 'cd #{pane_current_path} &
bind-key g run-shell "tmux neww -n ' 🞥 Git Add' 'cd #{pane_current_path} && (git ls-files -m -o --exclude-standard | fzf -m --print0 --reverse --header \"🞥 Select files to stage. use [tab] for multi selection\" --preview \"bat --diff --color=always --style=numbers,changes,grid {}\" | xargs -0 -o -t git add)'" bind-key g run-shell "tmux neww -n ' 🞥 Git Add' 'cd #{pane_current_path} && (git ls-files -m -o --exclude-standard | fzf -m --print0 --reverse --header \"🞥 Select files to stage. use [tab] for multi selection\" --preview \"bat --diff --color=always --style=numbers,changes,grid {}\" | xargs -0 -o -t git add)'"
# Get weather (Prefix-!) # Get weather (Prefix-!)
bind-key \! run-shell "tmux neww -n '🌡️ Weather Peek' '(echo \"Fetching Weather...\" && curl -s \"https://wttr.in/?lang=en\") | bat --paging always -p'" bind-key ! run-shell "tmux neww -n '🌡️ Weather Peek' '(echo \"Fetching Weather...\" && curl -s \"https://wttr.in/?lang=en\") | bat --paging always -p'"
############################ ############################
# Themes # Themes
@ -89,7 +89,8 @@ set -g history-limit 5000
bind -n C-k clear-history bind -n C-k clear-history
# Default Colors # Default Colors
set -g default-terminal "tmux-256color" set -g default-terminal "xterm-256color"
set-option -ga terminal-overrides ",xterm-256color:Tc"
# Home/End support # Home/End support
bind -n End send-key C-e bind -n End send-key C-e
@ -107,8 +108,8 @@ setw -g window-status-current-style bg="#282a2e"
setw -g window-status-current-style fg="#81a2be" setw -g window-status-current-style fg="#81a2be"
## highlight active window ## highlight active window
setw -g window-style 'bg=#282a2e' #setw -g window-style 'bg=#282a2e'
setw -g window-active-style 'bg=#1d1f21' #setw -g window-active-style 'bg=#1d1f21'
setw -g pane-active-border-style '' setw -g pane-active-border-style ''
## highlight activity in status bar ## highlight activity in status bar
@ -143,13 +144,13 @@ set -g status-left '#[fg=#f99157,bg=#2d2d2d]  #S #[fg=#f99157,bg=colour235] '
set -g status-right-length 100 set -g status-right-length 100
set -g status-right-style fg=black set -g status-right-style fg=black
set -g status-right-style bold set -g status-right-style bold
set -g status-right '#[fg=#6699cc,bg=#2d4d2d]  #[fg=#f99157,bg=#2d2d2d] %H:%M:%S #[fg=colour235]|#[fg=#6699cc,bg=#2d4d2d] #[fg=#f99157,bg=#2d2d2d] %y/%m/%d #[fg=colour235]|#[fg=#6699cc,bg=#2d4d2d] #[fg=#f99157,bg=#2d2d2d] @#H ' set -g status-right '#[fg=#6699cc,bg=#464646]  #[fg=#f99157,bg=#2d2d2d] %H:%M:%S #[fg=colour235]|#[fg=#6699cc,bg=#464646]  #[fg=#f99157,bg=#2d2d2d] %y/%m/%d #[fg=colour235]|#[fg=#6699cc,bg=#464646]  #[fg=#f99157,bg=#2d2d2d] @#H '
# make background window look like white tab # make background window look like white tab
set-window-option -g window-status-style bg=default set-window-option -g window-status-style bg=default
set-window-option -g window-status-style fg=white set-window-option -g window-status-style fg=white
set-window-option -g window-status-style none set-window-option -g window-status-style none
set-window-option -g window-status-format '#[fg=#6699cc,bg=#2d4d2d] #I #[fg=#999999,bg=#2d2d2d] #W #[default]' set-window-option -g window-status-format '#[fg=#6699cc,bg=#464646] #I #[fg=#999999,bg=#2d2d2d] #W #[default]'
# make foreground window look like bold yellow foreground tab # make foreground window look like bold yellow foreground tab
set-window-option -g window-status-current-style none set-window-option -g window-status-current-style none

View file

@ -10,14 +10,13 @@
local_version_file: "~/.ansible_gh_release_versions/{{ name }}" local_version_file: "~/.ansible_gh_release_versions/{{ name }}"
- name: Fetch latest release tarball url - name: Fetch latest release tarball url
shell: ansible.builtin.shell:
cmd: curl -s https://api.github.com/repos/{{ repo }}/releases/latest | jq -r '.assets[] | select(.browser_download_url|test("{{ filter }}")) | .browser_download_url' cmd: curl -s https://api.github.com/repos/{{ repo }}/releases/latest | jq -r '.assets[] | select(.browser_download_url|test("{{ filter }}")) | .browser_download_url'
warn: false
register: tar_url register: tar_url
changed_when: false changed_when: false
- name: Get latest version tag from github - name: Get latest version tag from github
shell: ansible.builtin.shell:
cmd: 'echo {{ tar_url.stdout }} | grep -oP "(?<=download\/).*(?=\/)"' cmd: 'echo {{ tar_url.stdout }} | grep -oP "(?<=download\/).*(?=\/)"'
changed_when: false changed_when: false
register: version register: version
@ -46,28 +45,28 @@
- name: Moving bin to /usr/local/bin - name: Moving bin to /usr/local/bin
become: true become: true
shell: | ansible.builtin.shell: |
cp /tmp{{ bin_path }} /usr/local/bin/ cp /tmp{{ bin_path }} /usr/local/bin/
when: version != local_version when: version != local_version
- name: Adding man page if needed - name: Adding man page if needed
become: true become: true
shell: | ansible.builtin.shell: |
cp /tmp{{ man_path }} /usr/share/man/man1/ cp /tmp{{ man_path }} /usr/share/man/man1/
register: added_man register: added_man
when: man_path is defined and (version != local_version) when: man_path is defined and (version != local_version)
- name: Update mandb if needed - name: Update mandb if needed
become: true become: true
shell: mandb || true ansible.builtin.shell: mandb || true
when: added_man is defined and (version != local_version) when: added_man is defined and (version != local_version)
- name: Adding autocomplete if needed - name: Adding autocomplete if needed
shell: | ansible.builtin.shell: |
cp /tmp/{{ autocomplete_path }} ~/.shellconfig/autocomplete/{{ name }}.autocomplete cp /tmp/{{ autocomplete_path }} ~/.shellconfig/autocomplete/{{ name }}.autocomplete
when: autocomplete_path is defined and (version != local_version) when: autocomplete_path is defined and (version != local_version)
- name: Updating local version entry - name: Updating local version entry
shell: echo {{ version }} > {{ local_version_file }} ansible.builtin.shell: echo {{ version }} > {{ local_version_file }}
when: version != local_version when: version != local_version