Compare commits

...

6 commits

Author SHA1 Message Date
6bf0b284f9 Merge branch 'updates' into 'main'
Nvim role cleanup

See merge request sagidayan/linux-config!22
2023-02-21 17:05:01 +00:00
9ae429848c
Nvim role cleanup 2023-02-21 18:51:51 +02:00
60a740f94a Merge branch 'updates' into 'main'
Neovim - treesitter only on workstation.

See merge request sagidayan/linux-config!21
2023-02-21 16:41:45 +00:00
f7493d2db2
Neovim - treesitter only on workstation. 2023-02-21 18:28:55 +02:00
0a25dbdf1f Merge branch 'updates' into 'main'
Updates to

See merge request sagidayan/linux-config!20
2023-02-21 15:54:56 +00:00
3bfed39c11
Updates to:
- neovim
- tmux
- alacritty
2023-02-21 17:43:02 +02:00
19 changed files with 239 additions and 60 deletions

View file

@ -14,8 +14,9 @@ Ansible Lint:
- ansible-lint --version
script:
- ansible-lint --force-color . &> lint-output.txt
- echo $? > status
- 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:
stage: x86 Systems

View file

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

View file

@ -1,5 +1,6 @@
---
window:
opacity: 0.9
# Blank space added around the window in pixels
padding:
x: 2
@ -47,6 +48,110 @@ cursor:
# Themes #
###########################################################
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
# Base16 Monokai 256 - alacritty color config
# Wimer Hazenberg (http://www.monokai.nl)
@ -319,4 +424,4 @@ schemes:
white: '#aeb3bb'
draw_bold_text_with_bright_colors: true
colors: *gruvbox
colors: *nightfox

View file

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

View file

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

View file

@ -10,7 +10,22 @@ if gb_status_ok then
have_theme = true
end
vim.opt.background = "dark"
if have_theme then
vim.cmd("colorscheme " .. vars.colorscheme)
local nightfox_status_ok, nightfox = pcall(require, 'nightfox')
if nightfox_status_ok then
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

View file

@ -1,7 +1,9 @@
require("user.settings")
require("user.packer")
require("user.init_plugins")
vim.cmd(":PackerInstall")
require("user.settings")
require("user.init_plugins")
require("user.lsp")
require("user.cmp")
require("user.treesitter")
@ -11,4 +13,3 @@ require("user.colors")
-- Make sure plugins are installed
--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
autopairs.setup {}
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 = {}
M.setup = function()
@ -49,11 +50,12 @@ local function lsp_highlight_document(client, bufnr)
group = "lsp_document_highlight",
desc = "Clear All the References",
})
vim.cmd [[
highlight LspReferenceText guifg=NONE guibg=#928374
highlight LspReferenceRead guifg=NONE guibg=#928374
highlight LspReferenceWrite guifg=NONE guibg=#928374
]]
local h_bg = vars.themes[vars.colorscheme].highlight_bg_color
if h_bg then
vim.cmd('highlight LspReferenceText guifg=NONE guibg=' .. h_bg)
vim.cmd('highlight LspReferenceWrite guifg=NONE guibg=' .. h_bg)
vim.cmd('highlight LspReferenceRead guifg=NONE guibg=' .. h_bg)
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", "<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>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", "<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
M.on_attach = function(client, bufnr)
if client.name == "tsserver" then
client.server_capabilities.documentFormattingProvider = false
end
--if client.name == "tsserver" then
-- client.server_capabilities.documentFormattingProvider = false
--end
lsp_keymaps(bufnr)
lsp_highlight_document(client, bufnr)
vim.cmd [[autocmd BufWritePre <buffer> lua vim.lsp.buf.formatting_sync()]]

View file

@ -5,8 +5,9 @@ if not status_ok then
return
end
lualine.setup({
lualine.setup {
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

@ -1,3 +1,5 @@
local treesitter_extention_exists, _ = pcall(require, 'user.packer_extention_treesitter')
return require("packer").startup(function(use)
-- Packer can manage itself
use 'wbthomason/packer.nvim'
@ -10,6 +12,7 @@ return require("packer").startup(function(use)
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-buffer',
'hrsh7th/nvim-cmp',
'hrsh7th/cmp-nvim-lsp-signature-help',
'onsails/lspkind.nvim',
'nvim-lua/lsp_extensions.nvim',
'glepnir/lspsaga.nvim',
@ -33,8 +36,13 @@ return require("packer").startup(function(use)
requires = { 'kyazdani42/nvim-web-devicons', opt = true }
}
-- -- Colorshemes -- --
-- Gruvbox
use 'ellisonleao/gruvbox.nvim'
-- Melange
use 'savq/melange'
-- Nightfox
use 'EdenEast/nightfox.nvim'
-- Git Gutter
use {
@ -54,10 +62,12 @@ return require("packer").startup(function(use)
requires = { { 'nvim-lua/plenary.nvim' } }
}
if treesitter_extention_exists then
use {
'nvim-treesitter/nvim-treesitter',
run = ':TSUpdate'
}
end
-- Beacon
use 'danilamihailov/beacon.nvim'

View file

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

View file

@ -1,5 +1,33 @@
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

View file

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

View file

@ -26,7 +26,7 @@ setw -g mouse on
# 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 -v -c "#{pane_current_path}"
# close window with <prefix-q>
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)'"
# 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
@ -89,7 +89,8 @@ set -g history-limit 5000
bind -n C-k clear-history
# 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
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"
## highlight active window
setw -g window-style 'bg=#282a2e'
setw -g window-active-style 'bg=#1d1f21'
#setw -g window-style 'bg=#282a2e'
#setw -g window-active-style 'bg=#1d1f21'
setw -g pane-active-border-style ''
## 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-style fg=black
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
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 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
set-window-option -g window-status-current-style none

View file

@ -5,6 +5,8 @@
theme: gruvbox
# The running user
running_user: "{{ ansible_user_id }}"
# for nvim - workstation should install extentions
nvim_extention_treesitter: true
roles:
- base
- fonts

View file

@ -10,14 +10,13 @@
local_version_file: "~/.ansible_gh_release_versions/{{ name }}"
- 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'
warn: false
register: tar_url
changed_when: false
- name: Get latest version tag from github
shell:
ansible.builtin.shell:
cmd: 'echo {{ tar_url.stdout }} | grep -oP "(?<=download\/).*(?=\/)"'
changed_when: false
register: version
@ -46,28 +45,28 @@
- name: Moving bin to /usr/local/bin
become: true
shell: |
ansible.builtin.shell: |
cp /tmp{{ bin_path }} /usr/local/bin/
when: version != local_version
- name: Adding man page if needed
become: true
shell: |
ansible.builtin.shell: |
cp /tmp{{ man_path }} /usr/share/man/man1/
register: added_man
when: man_path is defined and (version != local_version)
- name: Update mandb if needed
become: true
shell: mandb || true
ansible.builtin.shell: mandb || true
when: added_man is defined and (version != local_version)
- name: Adding autocomplete if needed
shell: |
ansible.builtin.shell: |
cp /tmp/{{ autocomplete_path }} ~/.shellconfig/autocomplete/{{ name }}.autocomplete
when: autocomplete_path is defined and (version != local_version)
- name: Updating local version entry
shell: echo {{ version }} > {{ local_version_file }}
ansible.builtin.shell: echo {{ version }} > {{ local_version_file }}
when: version != local_version

View file

@ -0,0 +1,4 @@
---
nvim_extention_treesitter: false
nvim_extention_treesitter_file: ~/.config/nvim/lua/user/packer_extention_treesitter.lua
empty_lua_module: "return {}"

View file

@ -22,3 +22,15 @@
copy:
src: dotfiles/nvim/
dest: ~/.config/nvim/
- name: Debug extentions
debug:
msg: "TreeSitter: {{ nvim_extention_treesitter }}"
- name: setup nvim extention treesitter
shell: |
echo {{ empty_lua_module }} > {{ nvim_extention_treesitter_file }}
when: nvim_extention_treesitter
- name: remove nvim extention treesitter
shell: "rm -rf {{ nvim_extention_treesitter_file }}"
when: not nvim_extention_treesitter