1
0
Fork 0
This commit is contained in:
Vladimír Dudr 2022-05-27 10:24:53 +02:00
parent 99dbd7eafd
commit 50872ffae2
4 changed files with 143 additions and 114 deletions

View file

@ -63,7 +63,7 @@ do
update network "$(ip -br addr show dev eth0 | awk '{ print $2"\t"$3 }')"
update wifi "$(iwctl station wlan0 show |grep 'Connected network' | sed 's/ */ /g' | cut -d ' ' -f 4-)"
which iwctl &>/dev/null && update wifi "$(iwctl station wlan0 show |grep 'Connected network' | sed 's/ */ /g' | cut -d ' ' -f 4-)"
#if [ -e /run/user/1000/cmus-socket ]
#then

View file

@ -100,6 +100,7 @@ hc --idle | {
### All drawing happens here
# echo -n "%{T5}" # set font
date="$(printf ' %%{F#efefef}%(%H:%M%)T{F#909090}, %(%Y-%m)T-%%{F#efefef}%(%d)T')"
for m in "${!monitors[@]}" ; do
monitor=${monitors[$m]}
@ -111,7 +112,7 @@ hc --idle | {
### center
#echo -n "%{c}%{U${colors[bright_orange]}}${windowtitle:0:150}%{U-}"
### print the right
res="$res%{r}$playing $separator $volume $separator $load $separator $date "
res="$res%{r}$playing $separator $volume $separator $load $separator $date "
#echo -en "%{r}$right $separator %{U#f2f229}$charge%{U-} $separator"
done
@ -143,7 +144,7 @@ hc --idle | {
;;
date)
#echo "resetting date" >&2
date="${cmd[*]:1}"
# date="${cmd[*]:1}"
;;
quit_panel)
exit
@ -162,7 +163,9 @@ hc --idle | {
# declare -A player_status
if [[ "${cmd[1]}" = cmus ]]
then
play_line=" ${cmd[3]:0:20}/${cmd[4]:0:20}- ${cmd[5]:0:20}"
play_line=" ${cmd[3]:0:20}/${cmd[4]:0:20}"
[[ -n ${cmd[5]} ]] && play_line="$play_line: ${cmd[5]:0:20}"
play_sym=
case "${cmd[2]}" in
off|Stopped)

View file

@ -1,75 +1,94 @@
--- PACKAGES {{{
local fn = vim.fn
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
packer_bootstrap = fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
local packer_bootstrap = fn.system({ 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path })
end
require('packer').startup(function(use)
require('packer').startup(function(use)
use 'wbthomason/packer.nvim'
use 'neovim/nvim-lspconfig'
-- use 'glepnir/lspsaga.nvim'
use {'hrsh7th/nvim-cmp', requires={'neovim/nvim-lspconfig'}}
use {'hrsh7th/cmp-nvim-lsp', requires={'hrsh7th/nvim-cmp'}}
use {'hrsh7th/cmp-buffer', requires={'hrsh7th/nvim-cmp'}}
use {'hrsh7th/cmp-path', requires={'hrsh7th/nvim-cmp'}}
use {'hrsh7th/cmp-nvim-lua', requires={'hrsh7th/nvim-cmp'}}
use { 'hrsh7th/nvim-cmp', requires = { 'neovim/nvim-lspconfig' } }
use { 'hrsh7th/cmp-nvim-lsp', requires = { 'hrsh7th/nvim-cmp' } }
use { 'hrsh7th/cmp-buffer', requires = { 'hrsh7th/nvim-cmp' } }
use { 'hrsh7th/cmp-path', requires = { 'hrsh7th/nvim-cmp' } }
use { 'hrsh7th/cmp-nvim-lua', requires = { 'hrsh7th/nvim-cmp' } }
use 'hrsh7th/vim-vsnip'
use {'hrsh7th/cmp-vsnip', requires={'hrsh7th/nvim-cmp', 'hrsh7th/vim-vsnip'}}
use {'onsails/lspkind.nvim'}
use 'simrat39/symbols-outline.nvim'
use 'hrsh7th/cmp-nvim-lsp-signature-help'
use { 'jose-elias-alvarez/null-ls.nvim', requires = { "nvim-lua/plenary.nvim" }}
use { 'hrsh7th/cmp-vsnip', requires = { 'hrsh7th/nvim-cmp', 'hrsh7th/vim-vsnip' } }
use { 'onsails/lspkind.nvim' }
use { 'simrat39/symbols-outline.nvim', cmd = 'SymbolsOutline' }
use { 'jose-elias-alvarez/null-ls.nvim', requires = { "nvim-lua/plenary.nvim" } }
use {'nvim-treesitter/nvim-treesitter', run=':TSUpdate'}
use {
'folke/trouble.nvim',
requires = "kyazdani42/nvim-web-devicons",
cmd = 'TroubleToggle',
keys = { 'n', '<space>t <Cmd>TroubleToggle<CR>' }
-- config = require('trouble').setup()
}
use { 'nvim-treesitter/nvim-treesitter', run = ':TSUpdate' }
use 'nvim-treesitter/playground'
use 'David-Kunz/treesitter-unit'
use({ "yioneko/nvim-yati", requires = "nvim-treesitter/nvim-treesitter" })
use {'nvim-telescope/telescope.nvim', requires={'nvim-lua/popup.nvim', 'nvim-lua/plenary.nvim'}}
use { 'nvim-telescope/telescope.nvim', requires = { 'nvim-lua/popup.nvim', 'nvim-lua/plenary.nvim' } }
use { 'nvim-telescope/telescope-fzf-native.nvim',
run = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && cmake --build build --config Release && cmake --install build --prefix build'
}
-- use {"ellisonleao/gruvbox.nvim", requires = {"rktjmp/lush.nvim"}}
-- use {"ellisonleao/gruvbox.nvim", requires = {"rktjmp/lush.nvim"}}
use 'morhetz/gruvbox'
-- use 'lifepillar/vim-solarized8'
-- use 'lifepillar/vim-solarized8'
use {'chrisbra/Colorizer', cmd='ColorToggle'}
use { 'chrisbra/Colorizer', cmd = 'ColorToggle', keys = { 'n', '<space>c <Cmd>ColorToggle<CR>' } }
use {'kdheepak/lazygit.nvim', keys= {'n', '<space>g <Cmd>LazyGit<CR>'}, cmd='LazyGit'}
use {'lewis6991/gitsigns.nvim', requires={'nvim-lua/plenary.nvim'}}
-- #aaaaaa
use { 'hoob3rt/lualine.nvim', requires = {'kyazdani42/nvim-web-devicons', opt = true}}
use { 'kdheepak/lazygit.nvim', keys = { 'n', '<space>g <Cmd>LazyGit<CR>' }, cmd = 'LazyGit' }
use { 'lewis6991/gitsigns.nvim', requires = { 'nvim-lua/plenary.nvim' } }
use {'AndrewRadev/linediff.vim', cmd='LineDiffAdd'}
use { 'hoob3rt/lualine.nvim', requires = { 'kyazdani42/nvim-web-devicons', opt = true } }
use { 'AndrewRadev/linediff.vim', cmd = 'LineDiffAdd' }
use "lukas-reineke/indent-blankline.nvim"
use 'b3nj5m1n/kommentary'
use 'airblade/vim-rooter'
use {'vlada-dudr/vim-php-cs-fixer', ft='php'}
use { 'vlada-dudr/vim-php-cs-fixer', ft = 'php' }
use 'editorconfig/editorconfig-vim'
use { 'scrooloose/nerdtree', disable=true }
use { 'kyazdani42/nvim-tree.lua', requires = 'kyazdani42/nvim-web-devicons' }
use { 'scrooloose/nerdtree', disable = true }
use { 'kyazdani42/nvim-tree.lua',
requires = 'kyazdani42/nvim-web-devicons',
config = 'require"nvim-tree".setup()',
cmd = { 'NvimTreeToggle', 'NvimTreeFindFile' },
keys = {
{ 'n', '<F3> <Cmd>NvimTreeToggle<CR>' },
{ 'n', '<F4> <Cmd>NvimTreeFindFile<CR>' },
} }
use {'vim-vdebug/vdebug', ft=php}
use { 'vim-vdebug/vdebug', ft = php }
use {'dyng/ctrlsf.vim', cmd='CtrlSF'}
use { 'dyng/ctrlsf.vim', cmd = 'CtrlSF' }
use {'fpob/nette.vim', ft=nette}
use { 'fpob/nette.vim', ft = nette }
use { 'ziglang/zig.vim', ft='zig' }
use { 'ziglang/zig.vim', ft = 'zig' }
use { 'folke/lua-dev.nvim' }
use {
'folke/trouble.nvim',
requires = "kyazdani42/nvim-web-devicons",
cmd = 'TroubleToggle',
keys = { 'n', '<space>t <Cmd>TroubleToggle<CR>'}
-- config = require('trouble').setup()
}
use {'AndrewRadev/tagalong.vim'}
use {'andymass/vim-matchup'}
if packer_bootstrap then
require('packer').sync()
@ -80,36 +99,36 @@ end)
--- PACKAGES }}}
--- OPTIONS {{{
vim.o.ruler=true
vim.o.mouse=''
vim.o.showcmd=true
vim.o.scrolloff=3
vim.o.ignorecase=true
vim.o.smartcase=true
vim.o.incsearch=true
vim.o.inccommand='split'
vim.o.hidden=true
vim.o.autoread=true
vim.o.completeopt='menuone,noinsert,noselect'
vim.o.tabstop=4
vim.o.softtabstop=4
vim.o.swapfile=true
vim.o.undofile=true
vim.o.expandtab=true
vim.o.shiftwidth=4
vim.o.number=true
vim.o.ruler = true
vim.o.mouse = ''
vim.o.showcmd = true
vim.o.scrolloff = 3
vim.o.ignorecase = true
vim.o.smartcase = true
vim.o.incsearch = true
vim.o.inccommand = 'split'
vim.o.hidden = true
vim.o.autoread = true
vim.o.completeopt = 'menuone,noinsert,noselect'
vim.o.tabstop = 4
vim.o.softtabstop = 4
vim.o.swapfile = true
vim.o.undofile = true
vim.o.expandtab = true
vim.o.shiftwidth = 4
vim.o.number = true
--vim.o.colorcolumn=0
--vim.o.foldmethod='marker'
vim.o.foldcolumn='auto:1'
vim.o.signcolumn='yes'
vim.o.list=false
vim.o.relativenumber=false
vim.o.foldenable=true
vim.o.cursorline=true
vim.o.autoindent=true
vim.o.smartindent=true
vim.o.fileencodings='ucs-bom,utf-8,default,cp852,latin1'
vim.o.path='**'
vim.o.foldcolumn = 'auto:1'
vim.o.signcolumn = 'yes'
vim.o.list = false
vim.o.relativenumber = false
vim.o.foldenable = true
vim.o.cursorline = true
vim.o.autoindent = true
vim.o.smartindent = true
vim.o.fileencodings = 'ucs-bom,utf-8,default,cp852,latin1'
vim.o.path = '**'
--vim.o.clipboard = "unnamedplus"
-- Buffer
@ -129,12 +148,13 @@ augroup END
local nvim_lsp = require('lspconfig')
local on_attach = function(client, bufnr)
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
-- require'completion'.on_attach()
-- Mappings.
local opts = { noremap=true, silent=true }
local opts = { noremap = true, silent = true }
buf_set_keymap('n', 'gD', '<Cmd>lua vim.lsp.buf.declaration()<CR>', opts)
buf_set_keymap('n', 'gd', '<Cmd>lua vim.lsp.buf.definition()<CR>', opts)
buf_set_keymap('n', 'K', '<Cmd>lua vim.lsp.buf.hover()<CR>', opts)
@ -156,23 +176,23 @@ local on_attach = function(client, bufnr)
buf_set_keymap("v", "<space>gf", "<cmd>lua vim.lsp.buf.range_formatting()<CR>", opts)
end
-- Use a loop to conveniently both setup defined servers
-- Use a loop to conveniently both setup defined servers
-- and map buffer local keybindings when the language server attaches
local servers = { 'phpactor', 'gopls', 'clangd', 'zls', 'hls' }
local servers = { 'phpactor', 'gopls', 'clangd', 'zls', 'hls', 'tsserver', 'sumneko_lua' }
for _, lsp in ipairs(servers) do
nvim_lsp[lsp].setup {
nvim_lsp[lsp].setup {
on_attach = on_attach,
capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
}
end
require'lspconfig'.omnisharp.setup{
cmd = { '/usr/bin/omnisharp', '--languageserver' , '--hostPID', tostring(pid) },
require 'lspconfig'.omnisharp.setup {
cmd = { '/usr/bin/omnisharp', '--languageserver', '--hostPID', tostring(pid) },
on_attach = on_attach,
capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
}
require'lspconfig'.powershell_es.setup{
require 'lspconfig'.powershell_es.setup {
bundle_path = '/home/sogun/devel/PowerShellEditorServices',
capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
}
@ -182,7 +202,7 @@ require'lspconfig'.powershell_es.setup{
--- LSP }}}
--- CMP {{{
local cmp = require'cmp'
local cmp = require 'cmp'
cmp.setup({
-- documentation = true,
@ -191,11 +211,12 @@ cmp.setup({
{ name = 'nvim_lua' },
{ name = 'buffer' },
{ name = 'path' },
{ name = 'nvim_lsp_signature_help' },
},
formatting = {
format = require'lspkind'.cmp_format({
-- mode = 'symbol',
}),
format = require 'lspkind'.cmp_format({
-- mode = 'symbol',
}),
},
window = {
-- completion = cmp.config.window.bordered(),
@ -222,36 +243,36 @@ vim.cmd 'smap <expr> <S-Tab> vsnip#jumpable(-1) ? \'<Plug>(vsnip-jump-prev)\'
-- vsnip }}}
--- gitsigns {{{
require'gitsigns'.setup{}
require 'gitsigns'.setup {}
--- gitsigns }}}
-- lualine {{{
require'lualine'.setup {
require 'lualine'.setup {
options = {
icons_enabled = true,
theme = vim.env.TERM ~= 'linux' and 'gruvbox' or nil,
component_separators = {'', ''},
section_separators = {'', ''},
component_separators = { '', '' },
section_separators = { '', '' },
disabled_filetypes = {}
},
sections = {
lualine_a = {'mode'},
lualine_b = {'branch'},
lualine_c = { {'filename', path = 1} },
lualine_x = {'encoding', 'fileformat', 'filetype'},
lualine_y = {'progress'},
lualine_z = {'location'}
lualine_a = { 'mode' },
lualine_b = { 'branch' },
lualine_c = { { 'filename', path = 1 } },
lualine_x = { 'encoding', 'fileformat', 'filetype' },
lualine_y = { 'progress' },
lualine_z = { 'location' }
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = {'filename'},
lualine_x = {'location'},
lualine_c = { 'filename' },
lualine_x = { 'location' },
lualine_y = {},
lualine_z = {}
},
tabline = {},
extensions = {'nerdtree'}
extensions = { 'nerdtree' }
}
-- lualine }}}
@ -264,7 +285,7 @@ require'lualine'.setup {
vim.g.nvim_tree_add_trailing = 1
vim.g.nvim_tree_special_files = ''
vim.cmd ( [[
vim.cmd([[
let g:nvim_tree_show_icons = {
\ 'git': 0,
\ 'folders': 0,
@ -272,18 +293,16 @@ let g:nvim_tree_show_icons = {
\ 'folder_arrows': 0,
\ }
]])
require'nvim-tree'.setup {
}
vim.api.nvim_set_keymap('n', '<F3>', [[<Cmd>NvimTreeToggle<CR>]], { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<F4>', [[<Cmd>NvimTreeFindFile<CR>]], { noremap = true, silent = true })
-- vim.api.nvim_set_keymap('n', '<F3>', '<Cmd>NvimTreeToggle<CR>', { noremap = true, silent = true })
-- vim.api.nvim_set_keymap('n', '<F4>', '<Cmd>NvimTreeFindFile<CR>', { noremap = true, silent = true })
-- }}} NvimTree
-- Telescope {{{
vim.api.nvim_set_keymap('n', '<Space>b', [[<Cmd>Telescope buffers<CR>]], { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<Space>f', [[<Cmd>Telescope fd<CR>]], { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<Space>T', [[<Cmd>Telescope<CR>]], { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<Space>b', [[<Cmd>Telescope buffers<CR>]], { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<Space>f', [[<Cmd>Telescope fd<CR>]], { noremap = true, silent = true })
vim.api.nvim_set_keymap('n', '<Space>T', [[<Cmd>Telescope<CR>]], { noremap = true, silent = true })
require("telescope").setup {
defaults = {
@ -317,6 +336,8 @@ n = {
}
}
require('telescope').load_extension('fzf')
--[[ local telescope_ag = vim.api.nvim_create_augroup('Telescope')
nvim.nvim_create_autocmd('FileType', { pattern='TelescopePrompt', command = nvim.nvim_buf_set_keymap('n', '' ]]
vim.cmd 'augroup Telescope'
@ -331,10 +352,10 @@ vim.cmd 'augroup END'
-- Telescope }}}
-- Tree sitter {{{
require'nvim-treesitter.configs'.setup {
require 'nvim-treesitter.configs'.setup {
ensure_installed = 'all', -- one of "all", "maintained" (parsers with maintainers), or a list of languages
highlight = { enable = true, },
playground = { enable = false, },
playground = { enable = true, },
yati = { enable = true, },
incremental_selection = {
enable = true,
@ -347,21 +368,21 @@ require'nvim-treesitter.configs'.setup {
},
indent = {
-- disable = { "php" },-- php indent SUCKS A LOT
enable = false,
enable = false,
},
}
vim.api.nvim_set_keymap('x', 'iu', ':lua require"treesitter-unit".select()<CR>', {noremap=true})
vim.api.nvim_set_keymap('x', 'au', ':lua require"treesitter-unit".select(true)<CR>', {noremap=true})
vim.api.nvim_set_keymap('o', 'iu', ':<c-u>lua require"treesitter-unit".select()<CR>', {noremap=true})
vim.api.nvim_set_keymap('o', 'au', ':<c-u>lua require"treesitter-unit".select(true)<CR>', {noremap=true})
vim.api.nvim_set_keymap('x', 'iu', ':lua require"treesitter-unit".select()<CR>', { noremap = true })
vim.api.nvim_set_keymap('x', 'au', ':lua require"treesitter-unit".select(true)<CR>', { noremap = true })
vim.api.nvim_set_keymap('o', 'iu', ':<c-u>lua require"treesitter-unit".select()<CR>', { noremap = true })
vim.api.nvim_set_keymap('o', 'au', ':<c-u>lua require"treesitter-unit".select(true)<CR>', { noremap = true })
--[[ vim.o.foldmethod = 'expr'
vim.o.foldexpr = 'nvim_treesitter#foldexpr()' ]]
--- Tree sitter }}}
-- Indent lines {{{
vim.g.indent_blankline_filetype_exclude = { 'help', 'NvimTree', 'TelescopePrompt', 'lspinfo' }
vim.g.indent_blankline_filetype_exclude = { 'help', 'NvimTree', 'TelescopePrompt', 'lspinfo' }
vim.g.indent_blankline_buftype_exclude = { 'terminal', 'nofile', 'prompt' }
-- indent lines }}}
@ -377,8 +398,8 @@ vim.g.php_cs_fixer_rules = [[
--vim.g.php_cs_fixer_php_path = 'php7' -- Path to PHP
vim.g.php_cs_fixer_path = '/usr/bin/php-cs-fixer' -- Path to PHP
vim.g.php_cs_fixer_enable_default_mapping = 1 -- Enable the mapping by default (<leader>pcd)
vim.g.php_cs_fixer_dry_run = 0 -- Call command with dry-run option
vim.g.php_cs_fixer_enable_default_mapping = 1 -- Enable the mapping by default (<leader>pcd)
vim.g.php_cs_fixer_dry_run = 0 -- Call command with dry-run option
vim.g.php_cs_fixer_verbose = 0
vim.g.php_cs_fixer_version = 3
@ -426,9 +447,13 @@ nls.setup({
end
}),
nls.builtins.formatting.phpcsfixer.with({
extra_args = { "--rules", '{ "@Symfony":true, "nullable_type_declaration_for_default_null_value":true, "array_syntax":{"syntax":"short"}, "binary_operator_spaces":{"default":"align_single_space_minimal"}, "fully_qualified_strict_types":false }' }
}),
nls.builtins.diagnostics.shellcheck
extra_args = { "--rules", '{ "@Symfony":true, "nullable_type_declaration_for_default_null_value":true, "array_syntax":{"syntax":"short"}, "binary_operator_spaces":{"default":"align_single_space_minimal"}, "fully_qualified_strict_types":false }' }
}),
nls.builtins.diagnostics.shellcheck,
nls.builtins.formatting.eslint,
-- nls.builtins.diagnostics.eslint,
nls.builtins.code_actions.eslint,
nls.builtins.diagnostics.yamllint,
}
})
@ -437,7 +462,7 @@ nls.setup({
-- color handling {{{
term = vim.env.TERM
if(term ~= 'linux' or vim.g.neoray)
if (term ~= 'linux' or vim.g.neoray)
then
vim.cmd('set termguicolors')
vim.g.gruvbox_contrast_dark = 'hard'

View file

@ -24,7 +24,8 @@
side-by-side = true
;file-decoration-style = none
file-style = normal
syntax-theme = gruvbox
syntax-theme = gruvbox-dark
hyperlinks = true
[interactive]
diffFilter = delta --color-only