This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let s:packpath = expand('~/.local/share/nvim/site/pack/minpac') | |
let s:hash_dir = expand('~/.local/share/nvim/site/pack/minpac/hashes') | |
let s:pattern = '/{opt,start}' | |
function! s:save_hashes() abort | |
let plugin_dirs = glob(s:packpath .. s:pattern, 1, 1) | |
if empty(plugin_dirs) | |
return | |
endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local M = {} | |
local module_name = 'map_utils' | |
local fn_store = {} | |
local function register_fn(fn) | |
table.insert(fn_store, fn) | |
return #fn_store | |
end | |
function M.apply_function(id) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Taken from here: | |
-- https://github.com/neovim/neovim/issues/14116#issuecomment-977555102 | |
function PromptBackspace() | |
-- Have to know the length of the prompt | |
local prompt = 2 | |
local cursor = vim.api.nvim_win_get_cursor(0) | |
local line = cursor[1] | |
local col = cursor[2] | |
if col ~= prompt then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
Dependencies: | |
Completion: | |
https://github.com/hrsh7th/nvim-cmp | |
https://github.com/hrsh7th/cmp-buffer | |
https://github.com/hrsh7th/cmp-path | |
https://github.com/saadparwaiz1/cmp_luasnip | |
Snippets: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- ========================================================================== -- | |
-- == EDITOR SETTINGS == -- | |
-- ========================================================================== -- | |
local set = vim.opt | |
set.hidden = true | |
set.swapfile = false | |
set.backup = false | |
set.hlsearch = false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env node | |
const os = require('os'); | |
const getNetworkAddress = (interfaces) => { | |
for (const name of Object.keys(interfaces)) { | |
for (const interface of interfaces[name]) { | |
const {address, family, internal} = interface; | |
if (family === 'IPv4' && !internal) { | |
return address; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cache": false, | |
"await": true | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" ============================================================================ " | |
" === EDITING OPTIONS === " | |
" ============================================================================ " | |
" Don't include vi compatibility | |
set nocompatible | |
" Sensible backspace | |
set backspace=indent,eol,start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Open Netrw on the directory of the current file | |
nnoremap <leader>dd :Lexplore %:p:h<CR> | |
" Toggle the Netrw window | |
nnoremap <Leader>da :Lexplore<CR> | |
if &columns < 90 | |
" If the screen is small, occupy half | |
let g:netrw_winsize = 50 | |
else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" ============================================================================ " | |
" === EDITING OPTIONS === " | |
" ============================================================================ " | |
" Don't include vi compatibility | |
set nocompatible | |
" Sensible backspace | |
set backspace=indent,eol,start |