Browse Source

Wed 28 Dec 2022 18:52:05 ACDT

master
Tovi Jaeschke-Rogers 2 years ago
parent
commit
f68da6c2b6
10 changed files with 136 additions and 107 deletions
  1. +5
    -1
      .config/aliasrc
  2. +4
    -1
      .config/nvim/lua/config/general/autocmd.lua
  3. +1
    -1
      .config/nvim/lua/config/general/colorscheme.lua
  4. +32
    -22
      .config/nvim/lua/config/general/options.lua
  5. +38
    -8
      .config/nvim/lua/config/general/remaps.lua
  6. +24
    -17
      .config/nvim/lua/config/lsp/init.lua
  7. +4
    -0
      .config/nvim/lua/config/telescope.lua
  8. +19
    -54
      .config/nvim/lua/packer-plugins.lua
  9. +4
    -2
      .local/bin/dwm-sss
  10. +5
    -1
      .zshrc

+ 5
- 1
.config/aliasrc View File

@ -42,4 +42,8 @@ alias \
tinker="docker-compose exec fpm php artisan tinker" \
phpunit="docker-compose exec fpm ./vendor/bin/phpunit" \
jsonlint="python -m json.tool" \
migseed="docker-compose exec fpm php artisan migrate --seed"
migseed="docker-compose exec fpm php artisan migrate --seed" \
dsa="docker kill $(docker ps -q)"
alias thermoview-run='docker-compose -f docker-compose.yml run desktop bash -c "/opt/local-electron.sh" ; rm -rf desktop/pulse-*'
alias thermoview-build-run='dce node gulp && docker-compose -f docker-compose.yml run desktop bash -c "/opt/build/build-local.sh && /opt/local-electron.sh" ; rm -rf desktop/pulse-*'

+ 4
- 1
.config/nvim/lua/config/general/autocmd.lua View File

@ -2,11 +2,14 @@
local aucmd_dict = {
FileType = {
{
pattern = "dart,vue,js",
pattern = "dart,vue,javascript,typescript,json",
callback = function()
vim.opt_local.tabstop = 2
vim.opt_local.softtabstop = 2
vim.opt_local.shiftwidth = 2
-- vim.bo.tabstop = 2 -- size of a hard tabstop (ts).
-- vim.bo.shiftwidth = 2 -- size of an indentation (sw).
-- vim.bo.softtabstop = 2 -- number of spaces a <Tab> counts for. When 0, feature is off (sts).
end,
},
},


+ 1
- 1
.config/nvim/lua/config/general/colorscheme.lua View File

@ -1,3 +1,3 @@
vim.cmd [[colorscheme moonfly]]
vim.cmd [[colorscheme gruvbox]]

+ 32
- 22
.config/nvim/lua/config/general/options.lua View File

@ -1,33 +1,43 @@
vim.g.mapleader = ' '
vim.o.clipboard = 'unnamedplus'
vim.opt.clipboard = 'unnamedplus'
vim.o.nohlsearch = true
vim.o.incsearch = true
vim.o.ignorecase = true
vim.opt.hlsearch = false
vim.opt.incsearch = true
vim.opt.ignorecase = true
vim.o.mouse = 'a'
vim.o.smartcase = true
vim.o.linebreak = true
vim.opt.mouse = 'a'
vim.opt.smartcase = true
vim.opt.linebreak = true
vim.o.noswapfile = true
vim.o.nobackup = true
vim.o.undodir = vim.fn.expand('~/.cache/nvim/undodir')
vim.o.undofile = true
vim.opt.smartindent = true
vim.o.encoding = 'utf-8'
vim.o.number = true
vim.o.relativenumber = true
vim.opt.swapfile = false
vim.opt.backup = false
vim.opt.undodir = vim.fn.expand('~/.cache/nvim/undodir')
vim.opt.undofile = true
vim.o.tabstop = 4
vim.o.softtabstop = 4
vim.o.expandtab = true
vim.o.shiftwidth = 4
vim.o.smarttab = true
vim.opt.encoding = 'utf-8'
vim.opt.number = true
vim.opt.relativenumber = true
vim.o.formatoptions = 'tqj'
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.expandtab = true
vim.opt.shiftwidth = 4
vim.opt.smarttab = true
vim.opt.scrolloff = 8
vim.opt.signcolumn = 'yes'
vim.opt.isfname:append('@-@')
vim.opt.updatetime = 50
vim.opt.colorcolumn = "80"
vim.opt.formatoptions = 'tqj'
vim.cmd[[let g:pdv_cfg_autoEndFunction = 0]]
vim.o.splitbelow = true
vim.o.splitright = true
vim.opt.splitbelow = true
vim.opt.splitright = true

+ 38
- 8
.config/nvim/lua/config/general/remaps.lua View File

@ -1,7 +1,11 @@
local options = { noremap = true }
-- Source init.lua
vim.api.nvim_set_keymap('n', '<leader>so', '<cmd>source ~/.config/nvim/init.lua<CR>', options)
vim.api.nvim_set_keymap('n',
'<leader>so',
'<cmd>source ~/.config/nvim/init.lua<CR>',
options
)
-- Don't copy "c" changes to primary register
vim.api.nvim_set_keymap('n', 'c', '"_c', options)
@ -14,22 +18,44 @@ vim.api.nvim_set_keymap('n', '<leader>vs', '<cmd>vsplit<cr>', options)
vim.api.nvim_set_keymap('n', '<leader>y', 'ggyG<C-o>', options)
-- Manually store session
vim.api.nvim_set_keymap('n', '<F5>', '<cmd>mksession! ~/.cache//nvim/session/manual_session.vim<CR>', options)
vim.api.nvim_set_keymap(
'n',
'<F5>',
'<cmd>mksession! ~/.cache//nvim/session/manual_session.vim<CR>',
options
)
-- Restore manually stored session
vim.api.nvim_set_keymap('n', '<F6>', '<cmd>source ~/.cache/nvim/session/manual_session.vim<CR>', options)
vim.api.nvim_set_keymap('n',
'<F6>',
'<cmd>source ~/.cache/nvim/session/manual_session.vim<CR>',
options
)
-- Restore auto saved session created on exit
vim.api.nvim_set_keymap('n', '<F7>', '<cmd>source ~/.cache/nvim/session/shutdown_session.vim<CR>', options)
vim.api.nvim_set_keymap('n',
'<F7>',
'<cmd>source ~/.cache/nvim/session/shutdown_session.vim<CR>',
options
)
-- Replace all is aliased to S.
vim.api.nvim_set_keymap('n', '<C-s>', '<cmd>%s//g<Left><Left>', options)
-- Navigating with guides
vim.api.nvim_set_keymap('n', '<leader><leader>', '<Esc>/<++><Enter>"_c4l', options)
-- vim.api.nvim_set_keymap('i', '<leader><leader>', '<Esc>/<++><Enter>"_c4l', options)
vim.api.nvim_set_keymap('v', '<leader><leader>', '<Esc>/<++><Enter>"_c4l', options)
vim.api.nvim_set_keymap('n',
'<leader><leader>',
'<Esc>/<++><Enter>"_c4l',
options
)
vim.api.nvim_set_keymap('v',
'<leader><leader>',
'<Esc>/<++><Enter>"_c4l',
options)
-- Spell-check
vim.api.nvim_set_keymap('n', '<leader>o', '<cmd>setlocal spell! spelllang=en_au<cr>', options)
vim.api.nvim_set_keymap('n',
'<leader>o',
'<cmd>setlocal spell! spelllang=en_au<cr>',
options)
-- Keep highlight when indenting
vim.api.nvim_set_keymap('v', '<', '<gv', options)
@ -51,3 +77,7 @@ vim.api.nvim_set_keymap('n', '<leader>ga', '<cmd>Git add .<CR>', options)
vim.api.nvim_set_keymap('n', '<leader>gA', '<cmd>Git add<CR>', options)
vim.api.nvim_set_keymap('n', '<leader>gc', '<cmd>Git commit<CR>', options)
vim.api.nvim_set_keymap('n', '<leader>gC', '<cmd>Git commit -a<CR>', options)
vim.api.nvim_set_keymap("x", "<leader>p", "\"_dP", options)
vim.api.nvim_set_keymap("n", "<leader>d", "\"_d", options)
vim.api.nvim_set_keymap("v", "<leader>d", "\"_d", options)

+ 24
- 17
.config/nvim/lua/config/lsp/init.lua View File

@ -1,19 +1,5 @@
local M = {}
local servers = {
'gopls',
'html',
'jsonls',
'pyright',
'tsserver',
'vimls',
'dartls',
'dockerls',
'intelephense',
'sqlls',
'vuels',
}
local function on_attach(client, bufnr)
-- Enable completion triggered by <C-X><C-O>
-- See `:help omnifunc` and `:help ins-completion` for more information.
@ -35,7 +21,7 @@ lsp_signature.setup {
},
}
local capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities())
local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
local opts = {
on_attach = on_attach,
@ -43,11 +29,32 @@ local opts = {
flags = {
debounce_text_changes = 150,
},
};
local servers = {
gopls = opts,
html = opts,
jsonls = opts,
pyright = opts,
tsserver = opts,
vimls = opts,
dartls = opts,
dockerls = opts,
intelephense = opts,
sqlls = opts,
volar = {
filetypes = {'typescript', 'javascript', 'vue', 'json'},
init_options = {
typescript = {
tsdk = '/usr/lib/node_modules/typescript/lib'
}
}
}
}
function M.setup()
for _, server_name in ipairs(servers) do
require('lspconfig')[server_name].setup(opts)
for server_name, o in pairs(servers) do
require('lspconfig')[server_name].setup(o)
end
end


+ 4
- 0
.config/nvim/lua/config/telescope.lua View File

@ -57,6 +57,10 @@ vim.keymap.set('n', '<C-p>', function()
end
end, options)
vim.keymap.set('n', '<A-p>', function()
require('telescope.builtin').find_files()
end, options)
vim.keymap.set('n', '<leader>df', function()
require("telescope.builtin").find_files({
prompt_title = "< VimRC >",


+ 19
- 54
.config/nvim/lua/packer-plugins.lua View File

@ -6,56 +6,32 @@ return require('packer').startup(function()
use 'gruvbox-community/gruvbox'
use 'bluz71/vim-moonfly-colors'
use { 'neoclide/coc.nvim', run = 'yarn install', disable = true }
use { 'SirVer/ultisnips' }
use { 'rcarriga/nvim-notify' }
use {
"neovim/nvim-lspconfig",
event = "BufReadPre",
wants = { "cmp-nvim-lsp", "nvim-lsp-installer", "lsp_signature.nvim" },
config = function()
require("config.lsp").setup()
end,
'VonHeikemen/lsp-zero.nvim',
requires = {
"williamboman/nvim-lsp-installer",
"ray-x/lsp_signature.nvim",
-- LSP Support
{'neovim/nvim-lspconfig'},
{'williamboman/mason.nvim'},
{'williamboman/mason-lspconfig.nvim'},
-- Autocompletion
{'hrsh7th/nvim-cmp'},
{'hrsh7th/cmp-buffer'},
{'hrsh7th/cmp-path'},
{'saadparwaiz1/cmp_luasnip'},
{'hrsh7th/cmp-nvim-lsp'},
{'hrsh7th/cmp-nvim-lua'},
-- Snippets
{'L3MON4D3/LuaSnip'},
{'rafamadriz/friendly-snippets'},
},
}
use {
"ray-x/lsp_signature.nvim",
}
use {
"hrsh7th/nvim-cmp",
event = "InsertEnter",
requires = {
{ "hrsh7th/cmp-nvim-lsp", after = "nvim-cmp" },
{ "f3fora/cmp-spell", after = "nvim-cmp" },
{ "hrsh7th/cmp-path", after = "nvim-cmp" },
{ "hrsh7th/cmp-buffer", after = "nvim-cmp" },
{ "hrsh7th/cmp-calc", after = "nvim-cmp" },
{ "quangnguyen30192/cmp-nvim-ultisnips", after = "nvim-cmp" },
{
"L3MON4D3/LuaSnip",
-- after = 'nvim-cmp',
wants = "friendly-snippets",
requires = {
{ "rafamadriz/friendly-snippets", after = 'nvim-cmp' },
},
config = function()
require("config.luasnip").setup()
end,
},
},
config = function()
require("config.cmp").setup()
end,
disable = false,
require('config.lsp')
end
}
use {
@ -83,14 +59,6 @@ return require('packer').startup(function()
use { 'nvim-treesitter/nvim-treesitter' }
-- use {
-- 'romgrk/barbar.nvim',
-- requires = {'kyazdani42/nvim-web-devicons'},
-- config = function()
-- require('config.barbar')
-- end
-- }
use {
'lewis6991/gitsigns.nvim',
config = function()
@ -133,7 +101,4 @@ return require('packer').startup(function()
require('config.nvim-neo-tree')
end
}
-- Local nvim plugin development
-- use '~/Software/nvim-phpdoc/phpdoc.nvim'
end)

+ 4
- 2
.local/bin/dwm-sss View File

@ -3,11 +3,13 @@
while true;
do
f=$(cat /sys/class/thermal/thermal_zone0/temp)
t=$(echo $f | cut -b -2).$(echo $f | cut -b 3-)°C
t=$(echo $f | cut -b -2).$(echo $f | cut -b 2-)°C
d=$(date '+%a %b %d, %H:%M')
p=$(pacman -Qu | grep -v "\[ignored\]" | wc -l)
pi=$(pacman -Q | wc -l)
c=$(docker ps -q | wc -l)
n=$(cat /sys/class/net/eno1/operstate)
s=$(df -h / | tail -n 1 | awk '{ print $4 }')
xsetroot -name " /: ${s} | Pkgs: ${p}/${pi} | ${t} | ${d} "
xsetroot -name " D: ${c} | /: ${s} | Pkgs: ${p}/${pi} | Net: ${n} | ${t} | ${d} "
sleep 60;
done;

+ 5
- 1
.zshrc View File

@ -178,10 +178,14 @@ lfcd () {
}
bindkey -s '^o' 'lfcd\n'
cdv () {
function cdv () {
cd $(xclip -selection clipboard -o)
}
function cdf () {
cd $(find . -type d -print | fzf)
}
function chpwd() {
print -n "\e]2;st - $(whoami)@$(hostname) - $(pwd | sed 's/\/home\/tovi/~/g')\a"
}


Loading…
Cancel
Save