Skip to content

Instantly share code, notes, and snippets.

@AlixShahid
AlixShahid / lspstatus.lua
Created November 7, 2021 14:09
Medium-Setting Up Neovim for Web Development - 5
require('lsp-status').status()
require('lsp-status').register_progress()
require('lsp-status').config({
indicator_errors = '',
indicator_warnings = '',
indicator_info = '',
indicator_hint = '',
indicator_ok = '',
current_function = true,
diagnostics = false,
@AlixShahid
AlixShahid / lspkind.lua
Created November 7, 2021 14:04
Medium-Setting Up Neovim for Web Development - 4
require('lspkind').init({
-- enables text annotations (default: true)
with_text = true,
-- enables text annotations (default: 'default')
-- default symbol map can be either 'default' or 'codicons' for codicon preset (requires vscode-codicons font installed)
preset = 'codicons',
-- override preset symbols (default: {})
symbol_map = {
@AlixShahid
AlixShahid / lspconfig.lua
Created November 7, 2021 13:45
Medium-Setting Up Neovim for Web Development - 3
-- options for lsp diagnostic
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
vim.lsp.diagnostic.on_publish_diagnostics, {
underline = true,
signs = true,
update_in_insert = true,
virtual_text = {
true,
spacing = 6,
--severity_limit='Error' -- Only show virtual text on error
@AlixShahid
AlixShahid / init.lua
Created November 7, 2021 07:49
Medium-Setting Up Neovim for Web Development - 2
--If you want to automatically ensure that packer.nvim is installed on any machine you clone your configuration to,
--add the following snippet (which is due to @Iron-E) somewhere in your config before your first usage of packer:
local execute = vim.api.nvim_command
local fn = vim.fn
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
fn.system({'git', 'clone', 'https://github.com/wbthomason/packer.nvim', install_path})
execute 'packadd packer.nvim'
end
@AlixShahid
AlixShahid / init.lua
Created November 7, 2021 05:30
Medium-Setting Up Neovim for Web Development - 1
--If you want to automatically ensure that packer.nvim is installed on any machine you clone your configuration to,
--add the following snippet (which is due to @Iron-E) somewhere in your config before your first usage of packer:
local execute = vim.api.nvim_command
local fn = vim.fn
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
fn.system({'git', 'clone', 'https://github.com/wbthomason/packer.nvim', install_path})
execute 'packadd packer.nvim'
end
@AlixShahid
AlixShahid / decode.js
Created September 30, 2021 13:04
Mentoring challenge 2, by McLarenCollege
function decipherThis(string) {
string_arr = string.split(' ') // [ "this", "is", "string" ]
result_array = []
for (i=0; i<string_arr.length; i++) {
word = string_arr[i]
// dealing with char Code
code = []
word_new = []
@AlixShahid
AlixShahid / backspace.js
Created September 30, 2021 13:02
Mentoring challenge 1, by McLarenCollege
function backspace(str, symbol) {
let result = []
for ( let i=0; i<str.length; i++ ) {
chr = (str[i])
if ( chr == symbol ) {
result.pop()
} else {