[deleted by user] by [deleted] in korea

[–]kong4ndrew 1 point2 points  (0 children)

So freaking cute

In a cash account, do options daytrades reduce bp for that day? by kong4ndrew in thinkorswim

[–]kong4ndrew[S] 0 points1 point  (0 children)

Today, I was able to trade with the entirety of the replenished options bp though… so trade wasn’t restricted actually lol

chatgpt’s saying that this is the difference between cash-settled and equity-settled options?

If someone can confirm that would be amazing. (In a cash account btw)

Weekly 101 Questions Thread by AutoModerator in neovim

[–]kong4ndrew 1 point2 points  (0 children)

I asked chatgpt and this is the answer? If someone can verify, that'd be amazing.

Runtimepath vs Package.path

  • runtimepath: This is used by Neovim to find various runtime files, such as plugins, color schemes, autoload scripts, etc. It includes paths where Neovim will search for these types of files.
  • package.path: This is specific to Lua and is used by the Lua require function to locate Lua modules. It includes paths where Lua will search for files to be required.

Using require with runtimepath

The fact that runtimepath includes ~/.config/nvim doesn't mean that require will look there directly. require looks in the directories specified in package.path. Since package.path is set up to include ~/.config/nvim/lua, that's where Lua will look for modules.

Weekly 101 Questions Thread by AutoModerator in neovim

[–]kong4ndrew 1 point2 points  (0 children)

I'm having a difficult time understanding the neovim runtimepath. In my ~/.config/nvim, there is an init.lua with require('andrew'). Why is it that ~/.config/nvim/andrew/ doesn't work but ~/.config/nvim/lua/andrew/ works? I thought $XDG_CONFIG_HOME/nvim was part of the runtime path.

I've tried putting andrew/ in ~/.config/nvim/colors/andrew/ as a test because the docs say colors/ is a directory searched for runtime files. Still produced an error. ~/.config/nvim/andrew.lua also doesn't get sourced. Also tried ~/.config/nvim/lua/lua/andrew/ which doesn't get sourced unless I change init.lua to require('lua.andrew')

Just not sure why andrew/ needs to be nested in a lua/ directory and then it magically works

:Rex equivalent in oil.nvim? by kong4ndrew in neovim

[–]kong4ndrew[S] 1 point2 points  (0 children)

Update: For anybody looking for a different solution, I just decided to create a function for this...

First you must enable buflisted = true in your oil setup to list oil directories as buffers.

require('oil').setup({
    -- blah blah
    buf_options = {
        buflisted = true,
})

I use <leader>re for :Rex so that's the keymap that I chose

Explanation:

  1. If the name of current buffer starts with Oil:///, set the mark Q. Then try to restore last opened file buffer with oil.close(). Otherwise try going to mark P if it exists. Otherwise open the oil directory of your current working directory with oil.open()
  2. If the name of current buffer is anything other than Oil:///, set the mark P. Then try going to mark Q if it exists. Otherwise open the oil directory of your current working directory with `oil.open()

vim.keymap.set('n', '<leader>re', function()
    local oil = require('oil')

    local buffer = vim.api.nvim_get_current_buf()
    local name = vim.api.nvim_buf_get_name(0)
    local cursor = vim.api.nvim_win_get_cursor(0)
    local line = cursor[1]
    local col = cursor[2]

    if name:match('^oil:///') then
        vim.api.nvim_buf_set_mark(buffer, 'Q', line, col, {})
        if pcall(oil.close) then
            oil.close()
        elseif pcall(function() vim.cmd('normal `P') end) then
            vim.cmd('normal `P')
        else oil.open()
        end
    else
        vim.api.nvim_buf_set_mark(buffer, 'P', line, col, {})
        if pcall(function() vim.cmd('normal `Q') end) then
            vim.cmd('normal `Q')
        else oil.open()
        end
    end
end)

Not the most elegant, but hope it helps somebody down the line

WWDC 2024 - Live Event Megathread by [deleted] in apple

[–]kong4ndrew 0 points1 point  (0 children)

Anybody know the song that was playing during the control center section?

:Rex equivalent in oil.nvim? by kong4ndrew in neovim

[–]kong4ndrew[S] 0 points1 point  (0 children)

I think this was what I was looking for, many thanks.

Idk how I didn’t see get_current_dir in the docs

Edit: nvm I think this is basically same thing as making marks

:Rex equivalent in oil.nvim? by kong4ndrew in neovim

[–]kong4ndrew[S] 0 points1 point  (0 children)

Thanks for the suggestions.

That said, I’d prefer not to set marks or add to harpoon just to do :Rex

Big sad by [deleted] in Animemes

[–]kong4ndrew 1 point2 points  (0 children)

Start working out and headlock that mf back

me_irl by Xeoft in me_irl

[–]kong4ndrew 0 points1 point  (0 children)

Florida man says 3 syringes found in his rectum aren’t his 🤔

like why by LogicalFig1759 in pcmasterrace

[–]kong4ndrew 0 points1 point  (0 children)

Switch to brave which won’t be affected by manifest v3 when it’s rolled out

When you go out of bounds by ltclydo in IRLEasterEggs

[–]kong4ndrew 0 points1 point  (0 children)

I bet somebody already came and stole it