Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
A committed Aug 3, 2023
1 parent 3adfcec commit 23c97b8
Show file tree
Hide file tree
Showing 11 changed files with 146 additions and 18 deletions.
2 changes: 1 addition & 1 deletion bin/docking.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -e

INT=eDP-1
EXT_1=DP-1
EXT_1=DP1-1
# EXT_2=DP-1-3

MODELINE=$(cvt 3840 2160 30 | grep -i modeline | sed "s/Modeline\ //")
Expand Down
15 changes: 15 additions & 0 deletions configs/nvim/after/queries/python/highlights.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
; extends

; Module docstring
(module . (expression_statement (string) @comment))

; Class docstring
(class_definition
body: (block . (expression_statement (string) @comment)))

; Function/method docstring
(function_definition
body: (block . (expression_statement (string) @comment)))

; Attribute docstring
((expression_statement (assignment)) . (expression_statement (string) @comment))
1 change: 1 addition & 0 deletions configs/nvim/init.lua
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
require 'opts'
require 'plugins'

6 changes: 3 additions & 3 deletions configs/nvim/lua/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ local enabled_packages = {
'packages/todo-comments',
-- 'packages/nvim-obsidian',
'packages/extended-syntax',
'packages/close-buffers',
'packages/import-cost',
'packages/todo-txt',
-- 'packages/close-buffers',
-- 'packages/import-cost',
-- 'packages/todo-txt',
'packages/glow',
'packages/obsidian'
}
Expand Down
7 changes: 5 additions & 2 deletions configs/nvim/lua/opts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ g.markdown_fenced_languages = {
'sass',
}

-- opt.verbose = 2
-- opt.verbosefile = "/Users/anton/.logs/nvim.log"
opt.backup = false
opt.clipboard = 'unnamedplus'
opt.colorcolumn = '120'
Expand Down Expand Up @@ -56,5 +54,10 @@ opt.wildignore = {'package-lock.json','yarn.lock'}
opt.wrap = false
opt.writebackup = false

-- opt.verbose = 2
-- opt.verbosefile = "/Users/anton/.logs/nvim.log"

vim.cmd([[iabbrev <expr> ymd% strftime("%Y%m%d")]])

vim.api.nvim_create_autocmd({ "InsertEnter" }, { command = "hi CursorLine ctermbg=8" })
vim.api.nvim_create_autocmd({ "InsertLeave" }, { command = "hi CursorLine ctermbg=none" })
4 changes: 3 additions & 1 deletion configs/nvim/lua/packages/fzf.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ local keys = {
b = { "<cmd>lua require('fzf-lua').buffers()<CR>", 'Search in buffers'},
q = { "<cmd>lua require('fzf-lua').quickfix()<CR>", 'Search in quickfix'},
h = { "<cmd>lua require('fzf-lua').oldfiles()<CR>", 'Search in opened files history'},
l = { "<cmd>lua require('fzf-lua').loclist()<CR>", 'Search in location list'},
l = { "<cmd>lua require('fzf-lua').blines()<CR>", 'Search in current buffer lines'},
v = { "<cmd>lua require('fzf-lua').grep_visual()<CR>", 'Grep in visual selection'},
L= { "<cmd>lua require('fzf-lua').loclist()<CR>", 'Search in location list'},
},
s = {
name = 'Search',
Expand Down
11 changes: 7 additions & 4 deletions configs/nvim/lua/packages/obsidian.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ local cmd = vim.cmd
local keymap = vim.keymap
local ui = vim.ui
local fn = vim.fn
local autocmd = vim.api.nvim_create_autocmd


local keys = {
o = {
Expand All @@ -24,12 +26,12 @@ local function new_note()
end

local function install(use)


-- use "MDeiml/tree-sitter-markdown"
use {
"epwalsh/obsidian.nvim",
-- lazy = true,
-- event = { "BufReadPre " .. vim.fn.expand "~" .. "/Dev/@A/notes/**.md" },
-- opt = true,
-- event = { "BufRead $NOTES_DIR*" },
config = function ()
require('obsidian').setup({
dir = "~/Dev/@A/notes",
Expand All @@ -53,7 +55,6 @@ local function install(use)
date_format = "%Y-%m-%d-%a",
time_format = "%H:%M",
},

follow_url_func = function(url)
-- Open the URL in the default web browser.
-- vim.fn.jobstart({"open", url}) -- Mac OS
Expand Down Expand Up @@ -94,6 +95,8 @@ end
local function post_setup()
vim.cmd(":au! BufNewFile,BufRead *.md set ft=lsp_markdown")
vim.cmd(":syn region markdownWikiLink matchgroup=markdownLinkDelimiter start='\\[\\[' end='\\]\\]' contains=markdownLinkUrl keepend oneline concealends")
vim.cmd([[:au! BufEnter,BufNewFile,BufRead *.md syn match markdownTag "#[0-9A-Za-z:._]\+"]])


local cwd = fn.getcwd()
-- TODO: ignore if current buffer is not empty
Expand Down
2 changes: 0 additions & 2 deletions configs/nvim/lua/packages/theme.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ local keys = {
local function install(use)
use({
'~/Dev/@A/vim-trash-polka',
config = function()
end
})
end

Expand Down
18 changes: 17 additions & 1 deletion configs/nvim/lua/packages/treesitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,24 @@ local function install(use)
run = ':TSUpdate',
config = function()
require('nvim-treesitter.configs').setup({
ensure_installed = enabled_treesitter_configs
ensure_installed = enabled_treesitter_configs,
auto_install = true,
highlight = {
enable = true,
}
})

local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
parser_config.markdown = {
install_info = {
url = "https://github.com/MDeiml/tree-sitter-markdown.git",
files = { "src/parser.c" },
branch = "main",
generate_requires_npm = false,
requires_generate_from_grammar = false,
},
filetype = "md",
}
end
},
{ 'nvim-treesitter/playground' },
Expand Down
5 changes: 1 addition & 4 deletions configs/nvim/lua/plugins.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
local packer = require('packer')
local has_prop = require('lib/utils/has_prop').has_prop
local table_merge = require('lib/utils/table_merge').table_merge
local enabled_packages = require('config').enabled_packages
Expand All @@ -10,9 +9,7 @@ has_prop(enabled_packages, 'pre_install', function(package)
package.pre_install()
end)

packer.startup(function (use)
use 'nvim-lua/plenary.nvim'

require('packer').startup(function (use)
-- Call install hooks
has_prop(enabled_packages, 'install', function(package)
package.install(use)
Expand Down
93 changes: 93 additions & 0 deletions configs/nvim/plugin/packer_compiled.lua.old
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
-- 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()

_G._packer = _G._packer or {}
_G._packer.inside_compile = true

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
if threshold then
table.insert(results, '(Only showing plugins that took longer than ' .. threshold .. ' ms ' .. 'to load)')
end

_G._packer.profile_output = results
end

time([[Luarocks path setup]], true)
local package_path_str = "/home/a8ka/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/home/a8ka/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/home/a8ka/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/home/a8ka/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua"
local install_cpath_pattern = "/home/a8ka/.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 = {}

time([[Defining packer_plugins]], false)

_G._packer.inside_compile = false
if _G._packer.needs_bufread == true then
vim.cmd("doautocmd BufRead")
end
_G._packer.needs_bufread = 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

0 comments on commit 23c97b8

Please sign in to comment.