get displayed signs in a buffer - vim

I'm trying to write a script that can get the signs in the sign column of a given buffer, I saw in the help that:
sign_getplaced([{expr} [, {dict}]]) sign_getplaced()
Return a list of signs placed in a buffer or all the buffers.
This is similar to the :sign-place-list command.
If the optional buffer name {expr} is specified, then only the
list of signs placed in that buffer is returned. For the use
of {expr}, see bufname(). The optional {dict} can contain
the following entries:
group select only signs in this group
id select sign with this identifier
lnum select signs placed in this line. For the use
of {lnum}, see line().
If {group} is '*', then signs in all the groups including the
global group are returned. If {group} is not supplied or is an
empty string, then only signs in the global group are
returned. If no arguments are supplied, then signs in the
global group placed in all the buffers are returned.
See sign-group.
To get all the signs in a given buffer (I want the lspconfig for now, but let's just say that all of them are okay for now).
:echo sign_getplaced(bufname())
shows: [{'signs': [], 'bufnr': 1}] which doesn't help
:echo sign_getplaced(bufname(), '*')
doesn't work, says "dictionary is required", sensible
:echo sign_getplaced(bufname(), {"group":'*'})
shows: [{'signs': [], 'bufnr': 1}] which also doesn't help
I need help to understand how to get the currently placed signs in a given buffer.

Related

As I run the Cellranger count, I get the following error: "The argument '--fastqs <PATH>...' requires a value but none was supplied"

I am following the 10x Cellranger steps and using the same files for cellranger count. I run this from the fastq directory that contains all the PBMCs fastq files and the GRCh38 files too.
You put a space between --fastqs= and /home/.../pbmc_1k_v3_fastqs, and thus it think you didn't provide an argument after --fastqs. There are two possible syntax:
either you want a space, but then don't put a =, as in --fastqs /home/.../pbmc_1k_v3_fastqs;
or you put an equal sign, but then don't put a space, as in --fastqs=/home/.../pbmc_1k_v3_fastqs.

Problems working out the re.compile mask/cypher

I have working code using re.compile that searches for a given key and extracts specified bytes from that line.
Working cypher
S011=re.compile(r"S0\w*\W*11\b")
Searches for 'S0' at the start and '11' further in (the intervening alphanumeric changes with each file)
S012PA041 11 1001650953.34N 72627.05E 426930.97227906.7 285.3227033224
I am trying to use the same method for a different input file but I can't work out the correct mask/cypher. There are several lines starting 'P1' so that in not exclusive enough; the 'P1....,V0' is the exclusive key. Again the numbers between the keys change with each event and file.
P1,0,01169-72-063,,1001,,1,2020:07:31:12:48:01.7,1,V01,2,,436389.57,7196330.69,,64.88354429,7.65691702,,64.88327349,7.65520631,,0.00,0.00,0.00,0.00,,248.04
I have tried these but with no success:
V0=re.compile(r"^P1\w*\W*V0")
V0=re.compile(r"^P1\w*\W*V0\w*\W*")
V0=re.compile(r"^P1\w*V0\w*")
After running more combinations than an safe-cracker on Red Bull, I've finally got the right sequence for the regex.
Line to be identified using 'P1' and further in 'V01' as search keys
P1,0,01169-72-063,,1001,,1,2020:07:31:12:48:01.7,1,V01,2,,436389.57,7196330.69,,64.88354429,7.65691702,,64.88327349,7.65520631,,0.00,0.00,0.00,0.00,,248.04
re.compile code to identify it.
V0=re.compile(r"^P1\s*,*:*\S*V01\s*,*:*\S*\b")

How to personalize PF key assignments in Control-M?

Control-M's ISPF client in zOS (mainframe) comes with a set of predefined values assigned to PF keys (function keys), such as:
PF2 = SPLIT
PF9 = SWAP
However, similar to other ISPF applications, I'd like to change the values of those PF keys (and a few others, such as PF2 = RETURN) like so:
PF2 = SPLIT NEW
PF9 = SWAP NEXT
And trying to use standard ISPF's primary command "PFKEYS" "KEYS" (typo, pointed out in first answer), via which you can adapt the values of your PF keys, doesn't seem to work for Control-M either (you only get error message "UNRECOGNIZED COMMAND", no matter on which screen you try this command).
Any suggestions about how to change those values for PF2 and PF9 anyhow?
PFKEYS is not a valid ISPF command. The proper commands to access the ISPF PF Key Definitions and Labels dialog are KEYS for context sensitive key assignments or ZKEYS for global key assignments.
Navigate into Control-M, then use the KEYS command to launch the dialog and assign the desired function key commands. You may need to explicitly enter the SAVE command to commit your key assignment changes to your profile (although PF3 should invoke an END, which includes a SAVE).
Subsequently, PFSHOW (or the short version, FKA) will add an "infobar" of sorts to your panel that shows the PF keys, and either the defined label or the first 8 chars of the command that is currently assigned to each function key. Enter PFSHOW OFF (or FKA OFF) to remove this display.
The KEYLIST ON/OFF command can be used to switch between default and custom key assignments for some product panels. Enter the KEYLIST command with no arguments to see if options are available. FWIW... I don't have access to Control-M, but our installation of other BMC products does not include custom keylists.
Some PFkey errors can be attributed to installation procedures that do not include the appropriate members in logon procs. For Control-M, these members appear to be CMTCMDS and/or CMTUCMDS. The sysadmins responsible for installing the product would likely need to address this type of issue. However, the issue described here provides no indication of an installation problem.

Makefile split name by token

I need to get a token from the name of current directory, but I want to split it by name.. so say if I have
/home/test/one_two_three
or
/home/test/two
at both cases I'd like to get the 'two' only, i.e. chop everything before after and including '_'
so far I have
result=$(notdir ${PWD})
but how do I then split it?
Thx!

Performing a sort using k1,1 only

Assume you have an unsorted file with the following content:
identifier,count=Number
identifier, extra information
identifier, extra information
...
I want to sort this file so that for each id, write the line with the count first and then the lines with extra info. I can only use the sort unix command with option -k1,1 but am allowed to slightly change the lines to get this sort.
As an example, take
a,Count=1
a,giulio
aa,Count=44
aa,tango
aa,information
ee,Count=2
bb,que
f,Count=3
b,Count=23
bax,game
f,ee
c,Count=3
c,roma
b,italy
bax,Count=332
a,atlanta
bb,Count=78
c,Count=3
The output should be
a,Count=1
a,atlanta
a,giulio
aa,Count=44
aa,information
aa,tango
b,Count=23
b,italy
bax,Count=332
bax,game
bb,Count=78
bb,que
c,Count=3
c,roma
ee,Count=2
f,Count=3
f,ee
but I get:
aa,Count=44
aa,information
aa,tango
a,atlanta
a,Count=1
a,giulio
bax,Count=332
bax,game
bb,Count=78
bb,que
b,Count=23
b,italy
c,Count=3
c,Count=3
c,roma
ee,Count=2
f,Count=3
f,ee
I tried adding spaces at the end of the identifier and/or at the beginning of the count field and other characters, but none of these approaches work.
Any pointer on how to perform this sorting?
EDIT:
if you consider for example the products with id starting with a, one of them has info 'atlanta' and appears before Count (but I wand Count to appear before any information). In addition, bb should be after b in alphabetical order for the ids. To make my question clearer: How can I get the IDs sorted by alphabetical order and such that for a given ID, the line with Count appears before the others. And how to do this using sort -k1,1 (This is a group project I am working on and I am not free to change the sorting command) and maybe changing the content (I tried for example adding a '~' to all the infos so that Count is before)
you need to tell sort, that comma is used as field separator
sort -t, -k1,1
For ASCII sorting make sure LC_ALL=C and LANG and LANGUAGE are unset

Resources