dotfiles

Personal dotfiles.
git clone git://vcs.sapka.me/dotfiles
Log | Files | Refs | Submodules

commit 8b6e7d578ce5c1d824a354ab462951af38455582
parent 68cdad55fa9b61aebf36e14a08b0482ebfd55f1e
Author: MichaƂ M. Sapka <michal@sapka.me>
Date:   Tue,  5 Apr 2022 23:52:41 +0200

Vim & Newsboat

Diffstat:
Anewsboat/config | 23+++++++++++++++++++++++
Anewsboat/urls | 20++++++++++++++++++++
Mnvim/init.lua | 68+++++++++++++++++++++++++++++++++++++++++++++++++-------------------
Anvim/lua/plugin/packer_compiled.lua | 97+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Anvim/plugins.lua | 53+++++++++++++++++++++++++++++++++++++++++++++++++++++
5 files changed, 242 insertions(+), 19 deletions(-)

diff --git a/newsboat/config b/newsboat/config @@ -0,0 +1,23 @@ +#show-read-feeds no +auto-reload yes + +browser "/usr/bin/open -a '/Applications/Brave\ Browser.app/' %u" + +bind-key j down +bind-key k up +bind-key j next articlelist +bind-key k prev articlelist +bind-key J next-feed articlelist +bind-key K prev-feed articlelist +bind-key G end +bind-key g home +bind-key d pagedown +bind-key u pageup +bind-key l open +bind-key h quit +bind-key a toggle-article-read +bind-key n next-unread +bind-key N prev-unread +bind-key D pb-download +bind-key U show-urls +bind-key x pb-delete diff --git a/newsboat/urls b/newsboat/urls @@ -0,0 +1,20 @@ +https://michal.sapka.pl/en/index.xml +---------------- +https://cprss.s3.amazonaws.com/rubyweekly.com.xml +https://feeds.feedburner.com/digest-programming +https://zendesk.engineering/feed +https://shopify.engineering/blog.atom +http://feeds.feedburner.com/HighScalability +---------------- +http://rss.slashdot.org/Slashdot/slashdotMain +---------------- +https://fabiensanglard.net/rss.xml +https://www.gog.com/pl/news/feed +https://grumpygamer.com/rss +https://lunduke.substack.com/feed +---------------- +https://kielban.pl/feed/ +---------------- +https://lukesmith.xyz/rss.xml +https://odysee.com/$/rss/@Luke/70 + diff --git a/nvim/init.lua b/nvim/init.lua @@ -15,26 +15,56 @@ vim.api.nvim_set_keymap("n", "<C-j>", "<C-w>k", opts) vim.api.nvim_set_keymap("n", "<C-k>", "<C-w>k", opts) vim.api.nvim_set_keymap("n", "<C-l>", "<C-w>l", opts) --- Plugins -local vim = vim -local execute = vim.api.nvim_command local fn = vim.fn --- ensure that packer is installed -local install_path = fn.stdpath('data')..'/site/pack/packer/opt/packer.nvim' + +-- Automatically install packer +local install_path = fn.stdpath "data" .. "/site/pack/packer/start/packer.nvim" if fn.empty(fn.glob(install_path)) > 0 then - execute('!git clone https://github.com/wbthomason/packer.nvim '..install_path) - execute 'packadd packer.nvim' + PACKER_BOOTSTRAP = fn.system { + "git", + "clone", + "--depth", + "1", + "https://github.com/wbthomason/packer.nvim", + install_path, + } + print "Installing packer close and reopen Neovim..." + vim.cmd [[packadd packer.nvim]] +end + +-- Autocommand that reloads neovim whenever you save the plugins.lua file +vim.cmd [[ + augroup packer_user_config + autocmd! + autocmd BufWritePost plugins.lua source <afile> | PackerSync + augroup end +]] + +-- Use a protected call so we don't error out on first use +local status_ok, packer = pcall(require, "packer") +if not status_ok then + return end -vim.cmd('packadd packer.nvim') -local packer = require'packer' -local util = require'packer.util' -packer.init({ - package_root = util.join_paths(vim.fn.stdpath('data'), 'site', 'pack') -}) ---- startup and add configure plugins -packer.startup(function() - local use = use - -- add you plugins here like: - -- use 'neovim/nvim-lspconfig' + +-- Have packer use a popup window +packer.init { + display = { + open_fn = function() + return require("packer.util").float { border = "rounded" } + end, + }, +} + +-- Install your plugins here +return packer.startup(function(use) + -- My plugins here + use "wbthomason/packer.nvim" -- Have packer manage itself + use "nvim-lua/popup.nvim" -- An implementation of the Popup API from vim in Neovim + use "nvim-lua/plenary.nvim" -- Useful lua functions used ny lots of plugins + + -- Automatically set up your configuration after cloning packer.nvim + -- Put this at the end after all plugins + if PACKER_BOOTSTRAP then + require("packer").sync() end -) +end) diff --git a/nvim/lua/plugin/packer_compiled.lua b/nvim/lua/plugin/packer_compiled.lua @@ -0,0 +1,97 @@ +-- Automatically generated packer.nvim plugin loader code + +if vim.api.nvim_call_function('has', {'nvim-0.5'}) ~= 1 then + vim.api.nvim_command('echohl WarningMsg | echom "Invalid Neovim version for packer.nvim! | echohl None"') + return +end + +vim.api.nvim_command('packadd packer.nvim') + +local no_errors, error_msg = pcall(function() + + local time + local profile_info + local should_profile = false + if should_profile then + local hrtime = vim.loop.hrtime + profile_info = {} + time = function(chunk, start) + if start then + profile_info[chunk] = hrtime() + else + profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6 + end + end + else + time = function(chunk, start) end + end + +local function save_profiles(threshold) + local sorted_times = {} + for chunk_name, time_taken in pairs(profile_info) do + sorted_times[#sorted_times + 1] = {chunk_name, time_taken} + end + table.sort(sorted_times, function(a, b) return a[2] > b[2] end) + local results = {} + for i, elem in ipairs(sorted_times) do + if not threshold or threshold and elem[2] > threshold then + results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms' + end + end + + _G._packer = _G._packer or {} + _G._packer.profile_output = results +end + +time([[Luarocks path setup]], true) +local package_path_str = "/Users/msapka/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/Users/msapka/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/Users/msapka/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/Users/msapka/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua" +local install_cpath_pattern = "/Users/msapka/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so" +if not string.find(package.path, package_path_str, 1, true) then + package.path = package.path .. ';' .. package_path_str +end + +if not string.find(package.cpath, install_cpath_pattern, 1, true) then + package.cpath = package.cpath .. ';' .. install_cpath_pattern +end + +time([[Luarocks path setup]], false) +time([[try_loadstring definition]], true) +local function try_loadstring(s, component, name) + local success, result = pcall(loadstring(s), name, _G.packer_plugins[name]) + if not success then + vim.schedule(function() + vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {}) + end) + end + return result +end + +time([[try_loadstring definition]], false) +time([[Defining packer_plugins]], true) +_G.packer_plugins = { + ["packer.nvim"] = { + loaded = true, + path = "/Users/msapka/.local/share/nvim/site/pack/packer/start/packer.nvim", + url = "https://github.com/wbthomason/packer.nvim" + }, + ["plenary.nvim"] = { + loaded = true, + path = "/Users/msapka/.local/share/nvim/site/pack/packer/start/plenary.nvim", + url = "https://github.com/nvim-lua/plenary.nvim" + }, + ["popup.nvim"] = { + loaded = true, + path = "/Users/msapka/.local/share/nvim/site/pack/packer/start/popup.nvim", + url = "https://github.com/nvim-lua/popup.nvim" + } +} + +time([[Defining packer_plugins]], false) +if should_profile then save_profiles() end + +end) + +if not no_errors then + error_msg = error_msg:gsub('"', '\\"') + vim.api.nvim_command('echohl ErrorMsg | echom "Error in packer_compiled: '..error_msg..'" | echom "Please check your config for correctness" | echohl None') +end diff --git a/nvim/plugins.lua b/nvim/plugins.lua @@ -0,0 +1,53 @@ +local fn = vim.fn + +-- Automatically install packer +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, + } + print "Installing packer close and reopen Neovim..." + vim.cmd [[packadd packer.nvim]] +end + +-- Autocommand that reloads neovim whenever you save the plugins.lua file +vim.cmd [[ + augroup packer_user_config + autocmd! + autocmd BufWritePost plugins.lua source <afile> | PackerSync + augroup end +]] + +-- Use a protected call so we don't error out on first use +local status_ok, packer = pcall(require, "packer") +if not status_ok then + return +end + +-- Have packer use a popup window +packer.init { + display = { + open_fn = function() + return require("packer.util").float { border = "rounded" } + end, + }, +} + +-- Install your plugins here +return packer.startup(function(use) + -- My plugins here + use "wbthomason/packer.nvim" -- Have packer manage itself + use "nvim-lua/popup.nvim" -- An implementation of the Popup API from vim in Neovim + use "nvim-lua/plenary.nvim" -- Useful lua functions used ny lots of plugins + + -- Automatically set up your configuration after cloning packer.nvim + -- Put this at the end after all plugins + if PACKER_BOOTSTRAP then + require("packer").sync() + end +end)