This file contains 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 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 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
-- | |
-- Move this file to your neovim lua runtime path ie. ~/.config/nvim/lua/au.lua | |
-- | |
local cmd = vim.api.nvim_command | |
local function autocmd(this, event, spec) | |
local is_table = type(spec) == 'table' | |
local pattern = is_table and spec[1] or '*' | |
local action = is_table and spec[2] or spec | |
if type(action) == 'function' then |
This file contains 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 function setup_rust_tools() | |
local tools = { | |
autoSetHints = true, | |
runnables = {use_telescope = true}, | |
inlay_hints = {show_parameter_hints = true}, | |
hover_actions = {auto_focus = true} | |
} | |
require('rust-tools').setup({ | |
tools = tools, | |
server = { |
This file contains 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 alt_key_mappings = { | |
{"code_lens", "n", "<leader>lcld","<Cmd>lua vim.lsp.codelens.refresh()<CR>"}, | |
{"code_lens", "n", "<leader>lclr", "<Cmd>lua vim.lsp.codelens.run()<CR>"} | |
} | |
local function set_lsp_config(client, bufnr) | |
require"lsp_signature".on_attach({ | |
bind = true, | |
handler_opts = {border = "single"} | |
}) |
This file contains 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
-- put this file somewhere in your nvim config, like: ~/.config/nvim/lua/config/lua-lsp.lua | |
-- usage: require'lspconfig'.sumneko_lua.setup(require("config.lua-lsp")) | |
local library = {} | |
local path = vim.split(package.path, ";") | |
-- this is the ONLY correct way to setup your path | |
table.insert(path, "lua/?.lua") | |
table.insert(path, "lua/?/init.lua") |
This file contains 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
-- ~/.config/nvim/lua/plugins/feline/colors.lua | |
-- One-dark colors | |
local _M = { | |
bg = '#2c323c', | |
fg = none, | |
yellow = '#e5c07b', | |
cyan = '#8abeb7', | |
darkblue = '#528bff', | |
green = '#98c379', |
This file contains 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
#Neovim Trick | |
Live Reload on plugin development and init.lua | |
# Demo | |
# How | |
* [ ] code |
This file contains 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
;;; Asynchronous detailed git modeline. | |
;; git-ml is free software: you can redistribute it and/or modify it under the | |
;; terms of the GNU General Public License as published by the Free Software | |
;; Foundation, either version 3 of the License, or (at your option) any later | |
;; version. | |
;; This is a rough sketch. Things to do before publishing it as a package: | |
;; | |
;; * Consider doing the checks per git directory instead of per buffer, then |
This file contains 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
font = "Bmono 12" | |
geometry = "0x0-62-62" | |
separator_height = 2 | |
padding = 2 | |
horizontal_padding = 2 | |
frame_width = 2 | |
markup = full | |
format = "<b>%s</b>\n%b" | |
icon_path = "" |