piersolenski / telescope-import.nvim

Import modules with ease
186 stars 8 forks source link

Feature: Ability to dynamically insert_top or insert_inline #5

Closed Dimfred closed 11 months ago

Dimfred commented 11 months ago

Depending what type of language I use, I would like to dynamically insert either at top or at cursor. E.g. In C++ I want to insert always at the cursor, because my imports won't be sorted correctly, in python my imports are sorted, hence inserting at top is completely fine.

For anyone searching this is my workaround for that:

local insert_at_top = true
if vim.bo.ft == "cpp" then
    insert_at_top = false
end

require("import.picker")({ insert_at_top = insert_at_top })